Nested data analysis using nlme: Analysis leaves out factor levels Nested data analysis using nlme: Analysis leaves out factor levels
I have a few questions regarding the analysis of nested data from an experiment.
In the study, participants viewed 50 stimuli for 3 durations  (50 ms, 500 ms, and 1000 ms, within-subjects, resulting in 150 trials per participant)  and provided 3 responses for each stimulus presentation. There were 2 groups of participants (between-subjects conditions), one group saw the stimuli in a darkened version and the other group saw lighter versions of the stimuli. The order of presentation was completely randomized (both regarding the stimuli and their duration of the presentation). The data is currently in long format (each trial is a row with the stimulus id, participant id, gender, duration, condition, and the three responses). What is the best way to analyze this type of data using R?
I have tried a mixed effects model (nlme) with subject id as random factor:
model_lme<-lme(response1 ~ condition * duration, random=~1|subj,data=dat)

In my results, I only get two of the three levels of the factor duration:
Fixed effects: response1 ~ condition * duration 
                Value  Std.Error   DF   t-value p-value
(Intercept)  4.094293 0.08266924 9979  49.52619  0.0000
condition1 0.122374 0.08266924   65   1.48028  0.1436
duration1  -0.315817 0.02026158 9979 -15.58699  0.0000
duration2  -0.004890 0.02026158 9979  -0.24135  0.8093

Am I using nlme correctly? Why is one level missing?
 A: You are asking three questions in your post. The first one (What is the best way to analyze this type of data using R?) makes little sense, as no one knows what is the question you are trying to answer.
As for using nlme correctly, probably you are doing something wrong. Note that you are not missing one level of duration, as the third level is the baseline compared to which other two are calculated. You are rather missing two interaction levels of condition*duration. I was curious to replicate you analysis with random data, and my output looks like this (ignore the actual numbers):
Fixed effects: response ~ condition * duration 
                               Value Std.Error   DF    t-value p-value
(Intercept)                 6.328458  3.414836 1486   1.853225  0.0640
conditionlight             -5.984724  4.829307    8  -1.239251  0.2504
duration50                 -1.945657  0.087851 1486 -22.147346  0.0000
duration500                -0.869570  0.087851 1486  -9.898285  0.0000
conditionlight:duration50   1.959904  0.124239 1486  15.775209  0.0000
conditionlight:duration500  0.818661  0.124239 1486   6.589375  0.0000

Maybe there is something wrong with the types of your variables (I used strings for condition and duration), but I could not get your output, so I don't know for sure. Try reading this, perhaps.
