BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

By "pertinent contrast" I mean a linear combination of means (in other words, a contrast) that addresses a sensible (in other words, pertinent) comparison. With respect to a significant interaction, you must ask yourself, "What comparison(s) should I make to figure out the nature of this interaction?" My previous point was that pairwise comparison of interaction means typically is not sufficient for this task (unless the interaction is 2 x 2).

 

You can, of course, add statements to obtain additional output, like estimates of main effects or of simple effects. The code I suggested is just that--a suggestion. You are free to use it or not, or alter it to suit your needs.

 

    random intercept / subject=trial1(subjectid group);

estimates the variance among multiple trials within subjects. You confirmed in a posting that you subsequently deleted that trials are, in fact, intended to be subsamples and that you have no research questions about the effect of trials on the mean of the response. TRIAL1 is a design unit that is nested within each SUBJECTID within each GROUP.

 

You could apply a simpler statistical analysis if you computed the mean of the response over the multiple trials for each syllable-set for each subject in each group, and then used those means as data in a simpler statistical model (a two-way factorial in a split plot design). If you had the same number of trials for each subject in each group, you would get the same test results with this analysis using a data set with observations at the subject by syllable-set level as you would with the analysis that uses a dataset with observations at the trial by syllable-set level (in other words, your current data set structure). However, you are missing data for some trials, so the results of the two approaches will not be identical for this study. The analysis using your current data set structure with a more complicated statistical model is (ideally) better, but for practical purposes, the simpler one may well be good enough. 

 

But you also said in the deleted post that "I am willing to see any effect of "trial" as a side question. There can be learning effect." which implies that TRIAL1 must be included as a fixed effects factor in the MODEL statement in some form. As the research scientist, you need to decide which approach you are taking to the role of TRIAL1 in your study. Ideally you would have determined this during the design phase of the study, before you actually ran trials.

 

    random _residual_ / group=syl;

Study Ch 9 "Heterogeneous Variance Models" in SAS® for Mixed Models, Second Edition. If you still have questions, feel free to ask again. The RANDOM _RESIDUAL_ combination in GLIMMIX replaces the REPEATED statement in MIXED.

 

 

nlpurumi
Obsidian | Level 7

Thanks for all of your help and advice.

Your reply is like quenching my thirst.

 

Here is what I developed so far with a help of others.

To run the proc glimmix and to get the R dataset for homoscedasticity testing, I modified your code to this:

 

proc glimmix data=dissertation1 plots=(studentpanel boxplot(fixed student));
class group slc subjectid trial1;
model ISI_Avg_sqrt = group|slc / ddfm=kr2;
output out=preddata pred=pred resid=r;
random intercept / subject=subjectid(group);
random slc / subject=subjectid(group);
random intercept / subject=trial1(subjectid group);
/* because I have not yet confirmed about homogeneity of variance*/
/*random _residual_ / group=slc;*/
lsmeans group*slc / plot=meanplot(sliceby=group join cl);
slice group*slc / sliceby=group diff alpha=.0083;
/*lsmestimate group*slc "Group effect: SLC 1 v 2" 1 -1 0 -1 1 0,
"Group effect: SLC 1 v 3" 1 0 -1 -1 0 1,
"Group effect: SLC 2 v 3" 0 1 -1 0-1 1
/ adjust=simulate(seed=29847);*/
run;

 

 

Or to use this:


proc mixed data=dissertation1 ic;
class group slc subjectid trial1;
model ISI_Avg_sqrt= group|slc /ddfm=kr2 outp=R;
random intercept / subject=subjectid(group);
random slc / subject=subjectid(group);
random intercept / subject=trial1(subjectid group);
repeated / group=slc;
run;

 

/*Then, test homoscedasticity assumption*/

data R1; set R;
absr=ABS(RESID);
run;
proc glm data=R1;
class group slc subjectid trial1;
model ABSR=group|slc;
run;

 

However, I still have a remaining question regarding how I will deal with "trial" variable.

Although I did not include any research question asking the effect of trial, I think when I planned my statistical analysis models, I included "trial" as part of my model.

So my question is whether above proc glimmix or proc mixed codes reflected what I planned.

I cannot figure out what goes where in SAS codes to reflect above mixed model equation more authentically.

There is also possibility that I can change my equations if needed.

 

Thanks in advance for your help.

 

 

 

sld
Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Your current codes do not match the description of what you planned.

 

The methods in your dissertation proposal describe a model that linearly regresses a response variable on both SLC and TRIAL1, with random coefficients. Both of these variables are ordered, so regression is a plausible approach. But because SLC and TRIAL1 are in the CLASS statement of your SAS codes, the models specified by your SAS codes treat SLC and TRIAL1 as classification (categorical) factors, so when either SLC or TRIAL1 or both appear in the MODEL statement, you get an ANOVA model, not a regression model.

 

 

Everyone starts learning statistical methods knowing nothing at the beginning. The modeling options for your study design are relatively complex, and your current understanding of these models is still very limited. You can certainly learn to do these models correctly, but there is a lot to learn, too much for me to take you through that process in this SAS Community forum. I highly recommend that you find help at your institution from a statistical consultant or faculty member, in addition to self-study and/or additional classes. These are wonderful tools for you to have at your disposal in the future, but these tools take work to acquire. Good luck and have fun!

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 32 replies
  • 2434 views
  • 2 likes
  • 2 in conversation