Multiple-mediation example with lavaan

This post extends this previous one on multiple-mediation with lavaan. Here I modeled a ‘real’ dataset instead of a randomly generated one. This dataset we used previously for a paper published some time ago. There we investigated whether fear of an imperfect fat self was a stronger mediator than hope of a perfect thin self on dietary restraint in college women. At the time of the paper’s publication we performed the analysis using the SPSS macro INDIRECT . However,
Continue reading “Multiple-mediation example with lavaan”

Multiple-mediation example with lavaan

Multiple-mediator analysis with lavaan

I wrote this brief introductory post for my friend Simon. I want to show how easy the transition from SPSS to R can be. In the specific case of mediation analysis the transition to R can be very smooth because, thanks to lavaan, the R knowledge required to use the package is minimal. Analysis of mediator effects in lavaan requires only the specification of the model, all the other processes are automated by the package. So, after reading in the data, running the test is trivial.
Continue reading “Multiple-mediator analysis with lavaan”

Multiple-mediator analysis with lavaan

Four dimensions in two dimensions

scatterplot of reaction time differences

This scatterplot is one of the best data visualisation I made. I like it because it concentrates a lot of information into a single visualisation. The scatterplot displays four dimensional data (i.e., four variables) using a two dimensional scatterplot. I made the first implementation in R, but because I wanted to add interactivity I switched to d3.js. Below I describe the choices I made to display the information and how I coded them in d3.js. Continue reading “Four dimensions in two dimensions”

Four dimensions in two dimensions

Streamgraphs in base::R [e.II]

Until recently I did not have a practical application in which to use streamgraphs. In fact, I still find the visualisation complex to understand, abstract and a bit too artistic. While I recognise that the strength of streamgraphs is the display of all the time series’ values into one (possibly interactive) plot, the amount of data displayed is massive, with many streams and even more data points. Because of the amount of data displayed Continue reading “Streamgraphs in base::R [e.II]”

Streamgraphs in base::R [e.II]

Streamgraphs in base::R [e.I]

This is the first of a series of four post on producing a streamgraph in plain R code. Here I present a very simple R script plotting a streamgraph. In this post I made streamgraph in d3.js, but I wanted to be able to do the same in R, to not depend on a webpage, or without requiring additional libraries (e.g. the streamgraph htmlwidgtet is only a wrapper around d3, and does not work always smoothly).
Continue reading “Streamgraphs in base::R [e.I]”

Streamgraphs in base::R [e.I]

Making up for univariate [DAI IVb]

This post is an extension of this one, which was (supposed to be) the final post of the coursera course ‘data analysis and interpretation’. This current post extends or complements the previous one because in that assignment I forgot to include univariate graphs in my plot. Since I only had a bivariate graph, the other reviewers failed my assignment. I was quite disappointed by their reaction, but I understood their motives. If univariate graphs get points and the absence thereof does not, I was righteously failed. Therefore, in this post I try to fix my previous mistake including three univariate graphs. The conclusion one can gather from these graphs remains unchanged and one should Continue reading “Making up for univariate [DAI IVb]”

Making up for univariate [DAI IVb]

Visualizing participants performance [wbwit III]

This is the third post on the development of a web-based word identification task. See this post for the implementation of the word identification task and this post for uploading the participants results to the server. This post describes how to plot the Continue reading “Visualizing participants performance [wbwit III]”

Visualizing participants performance [wbwit III]

Citations Network

This post describes the visualisation of a social network I made for a Coursera course on Data Visualisation. For this specific assignment I opted for gathering data on my own rather than using the datasets provided by the course instructor. I wanted to gather the data myself to try to visualise ‘real’ data. With real data I mean data that I try to scrape from the web and visualise. Basically with ‘real’ data I mean what other people call dirty data (i.e. data that is not been processed or polished before use). The question was also whether I could Continue reading “Citations Network”

Citations Network

Cheat Hunt [DAI III]

This post title is inspired by the title of a movie, witch hunt, I did not see, but I do like the sound of the title. I decided to change the dataset I am exploring for the data management and visualization course (if you need an introduction check this previous post). I decided to change dataset because it is not interesting to do the assignments with an already clean dataset. In fact, this week assignment requires pure data management, which is 1) identification and removal of missing values 2) computation of new variables etc. Since my dataset is already clean and only has three variables, I have nothing to do for the assignment. In the previous assignment I already came up with a new variable, and I was not capable to invent something new. But then I got a fantastic idea.

Continue reading “Cheat Hunt [DAI III]”

Cheat Hunt [DAI III]

Loading data and frequencies [DAI -II]

Second assignment for the Coursera Data Management and Visualization ‘challenge’ (here is the introduction). I rename the data management and visualization course to challenge since it has been a bit challenging to keep up with the weekly deadlines (and this is only the second week). But I am happy I am still close to the deadline when submitting the assignments. The goal of this second assignment is to load the data set and explore it by means of some descriptive statistics. Below I adapted the sample text for this assignment.
Continue reading “Loading data and frequencies [DAI -II]”

Loading data and frequencies [DAI -II]