Hello! 

I would appreciate any help with my model design. Each subject had a few surgeries (from 1 to 5) ("surgery number"). These subjects
had a test taken a few times after each surgery (from 1 to 6 times) ("test time"). There was
supposed to be a decrease in the dependent variable (test_results) immediately
after each surgery.  I coded both
variables as continuous (surgery_number and test_time).
 
I wonder if I specified fixed and random effects correctly. I
also think there might be some correlation between the surgery numbers but I am not
sure about how to specify it in the model. 
 
x<-lme(test_results~ surgery_number*test_time, random=~1|id/surgery_number)
s12<-update(x, correlation=corAR1(form=~1|id/surgery_number))
 
Thanks!
Julia

	[[alternative HTML version deleted]]

