Setting up a stacked dataframe for multilevel model analysis in R

I need to set up my data frame into a stacked or long form in order to do a random crossed effects multilevel analysis.

My random factors are participants and items (words in the assessment)
My fixed factors are the item characteristics e.g. word length, neighbourhood frequency and neighbourhood density. As well as the participants response times.

Each participant saw the same 20 words under the same conditions. My aim is to test for a difference in response time based on the word characteristics mentioned above.

I have a few questions I was hoping someone could help me with:

  1. I know that I need a random crossed effects multilevel analysis, but I have no idea how to stack the data frame so that I can run this analysis. Looking for code to do this in R.
    This is sort of what I need it to look like (I think):

  1. I am unsure if I need to first factor my word characteristics into groups (E.g. high density, low density, high frequency, low frequency etc.) Or if I can use the raw scores for this and keep them as continuous factors?

  2. Can I then use the lme4 package to run the multilevel analysis to answer my question "is there a difference in response times for different word characteristics"?

Would really appreciate the help as I am very new to R.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.