user9563941
user9563941

Reputation: 1

lsmeans and continuous time

I would like to have your help on this problem. I wish to express the evolution of a quality of life score over the time with adjustment on clinical factors. I work on a cohort of more than 1000 patients and a quality of life form was delivered every 3 months. Time is considered continuous as patients did not fill the form exactly at same time.

Here is my problem I used a linear mixed model with fixed factors (the sex and the prognosis). I would like to obtain the average score at 3, 6, 9 and 12 months from this model. I used the lsmeans function but the score obtained corresponds to average time. How can I get average scores from my model at these 4 different times? You will find below my code and the result I get with lsmeans

mod_mix2 <- lme(score_utilite~delai+prono1+sex1,random = ~ delai|numero_patient, data = qdv,na.action=na.omit,method="ML") lsmeans(mod_mix2, specs ="delai")

$lsmeans delai lsmean SE df lower.CL upper.CL 10.21976 0.8145542 0.005835597 1016 0.803103 0.8260054

Results are averaged over the levels of: prono1, sex1 Confidence level used: 0.95

$contrasts contrast estimate SE df z.ratio p.value (nothing) nonEst NA NA NA NA

Results are averaged over the levels of: prono1, sex1

Thank you very much

Upvotes: 0

Views: 284

Answers (1)

Russ Lenth
Russ Lenth

Reputation: 6780

Try

lsmeans(mod_mix2, specs ="delai",
    at = list(delai = c(3,6,8,12)))

Upvotes: 0

Related Questions