Hi, thanks for letting me know- I did end up making a new post because it was easier for me to re-collect my thoughts that way but here is all my info: Hello! I am very new to SAS and therefore might not include all the information needed for this question to be answered successfully but I'll try. I but need to use it for work though and need to figure out how to include multiple values to an input (I think). To sum up my code, we have 30 subjects and on each subject at week 2, for example, we had two evaluators rate them for body condition on a scale of 1-5. I'd like to include both values from each assessor to each subject, but am unsure how to do that. Here is my code with the value of one assessor which works fine: /*ANOVA Code*/
Data BodyCondition;
infile datalines dlm='09'x;
input PatientID Treatment$ Week Age Sex$ BodyCondition;
datalines;
1 TreatmentA 0 14 F 4.5
1 TreatmentA 2 14 F 4.5
1 TreatmentA 4 14 F 4
1 TreatmentA 10 14 F 4
1 TreatmentA 16 14 F 4
2 TreatmentB 0 3 F 5
2 TreatmentB 2 3 F 5
2 TreatmentB 4 3 F 5
2 TreatmentB 10 3 F 5
2 TreatmentB 16 3 F 5
;
RUN;
Proc freq data=BodyCondition;
table age sex treatment;
Run;
Proc Print data=BodyCondition;
Run;
Proc glimmix data=BodyCondition;
Weekx = Week;
class PatientID Treatment Week Sex;
model BodyCondition = Treatment|Week Week|Sex age/ ddfm=kr;
random Week / subject=PatientID type=cs residual;
lsmeans Treatment|Week / pdiff adjust=tukey lines;
lsmeans Week|Sex / pdiff adjust=tukey lines;
output out=second predicted=pred residual=resid
residual(noblup)=mresid student=studentresid student(noblup)=smresid;
Run;
Proc sgplot data=second;
vbox smresid / group=Treatment datalabel;
Run;
Proc sgplot data=second;
vbox smresid / group=Week datalabel;
Run;
Proc sgscatter data=second;
plot studentresid*(pred Week Treatment);
Run;
Proc univariate data=second normal plot;
var studentresid;
Run; So in the code above I have one value for "BodyCondition", but I would like each patient to have 2 values for this. From what I've seen other people do I tried doing this: /*ANOVA Code*/
Data BodyCondition;
infile datalines dlm='09'x;
input PatientID Treatment$ Week Age Sex$ BodyCondition1-BodyCondition2;
datalines;
1 TreatmentA 0 14 F 4.5 5
1 TreatmentA 2 14 F 4.5 4
1 TreatmentA 4 14 F 4 4.5
1 TreatmentA 10 14 F 4 4.5
1 TreatmentA 16 14 F 4 4
2 TreatmentB 0 3 F 5 5
2 TreatmentB 2 3 F 5 4.5
2 TreatmentB 4 3 F 5 5
2 TreatmentB 10 3 F 5 5
2 TreatmentB 16 3 F 5 4.5 I made the BodyCondition input into "BodyCondition1-BodyCondition2". However, if I only change that, the errors that come up are "ERROR: Response variable BodyCondition is not in the data set and is not defined through programming statements.", "ERROR: Variable SMRESID not found. ERROR: Variable TREATMENT not found.", "ERROR: Variable SMRESID not found. ERROR: Variable WEEK not found.", which makes sense, but if I change all BodyCondition to BodyCondition1-BodyCondition2 then it just won't even run the results at all because it is so messed up. Really just need to find a way to include two body condition scores from the two different evaluators evaluating the same thing per patient. I hope I've included enough information- I am pretty stuck as I can't reach out for help from anyone until next week. Appreciate any help! Thank you
... View more