Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Repeated measures with no subject

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 08-14-2024 07:57 PM
(1645 views)

Dear SAS Community,

I have some data that I want to anlalyze as repeated measures. Since I dont have blocks I didnt include the random intercept/subject= line in my model so I just want to make sure that the model Im using is correct. I would greatly appreciate your input.

Harvest is the date the fruits were harvested (2 dates), and what I want to use as repeated measures. Variety is the fruit variety (3 different varieties), and weeks are the number of weeks the fruits were storaged in a coldroom before the measurements like FirmAvg were assesed (after 1 week, 3 weeks, and 6 weeks).

proc glimmix data=one;

class harvest variety weeks;

model FirmAvg=harvest|variety|weeks/dist=lognormal ddfm=km;

random harvest/ residual type=cs;

run;

I would greatly appreciate your feedback.

Thank you very much

Caroline

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Yes. You could use PROC CATMOD to do ANOVA.

Use PROC CATMOD or PROC LOGISTIC to do logistic model (either ordinal or non-ordinal data.).

Use PROC CATMOD or PROC LOGISTIC to do logistic model (either ordinal or non-ordinal data.).

20 REPLIES 20

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

The syntax looks reasonable to me.

Thanks,

Jill

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi Jiltao,

Thank you very much for your reply. Since I dont have blocks, that was my concern, not having the intercept/subject line in my model. I dont know what my subject should be and if I have one. I attached an excel sheet with the data that shows the independent var: harvest date, variety, and weeks in storage, and the dep var storage firm avg. To give you some context, the fruits (different varieties) were harvested at two different dates (day 1 and day 55), and stored in a coldroom during 1, 3, and 6 weeks. After that, they were assesed for firmness (firm avg). So I want to use harvest date as repeated measures, to see if the harvest date has an effect on the fruit firmness. I also want to know the effect of the variety and weeks in storage on the firmness.

Thank you very much!

Caroline

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you cannot identify subjects, that is, for the first 5 observations for Variety BL516 at wk1 --

They might not be the same subjects for the 5 observations appearing later for BL516 for wk 3 -- then you might not have repeated measures data. Just fit an ANOVA model.

If you can say that the first observation in the data (BL516 for wk1) is the same subject as the first BL516 for wk3, and so on so forth for other observations, then you have repeated measures data, and you can add a variable such as ID to identify these subjects. Then you would have a repeated measures data.

Hope this helps,

Jill

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you so much for your reply! Strictly speaking, the first 5 fruits for variety BL516 at week 1 are not the same fruits I used to do the measures at week 3, and so forth, but since the variety is the same for week1, 3, and 6, what if I treat variety as the subject?

Thanks

Caroline

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If you don't have SUBJECT= cluster variable,that means you don't have RANDOM effect(a.k.a it is not MIXED model).

I guess you can fix GLM model instead.

proc genmod data=one;

class harvest variety weeks;

..............

or

proc glm data=one;

class harvest variety weeks;

..........

I guess you can fix GLM model instead.

proc genmod data=one;

class harvest variety weeks;

..............

or

proc glm data=one;

class harvest variety weeks;

..........

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you very much for your reply. Im thinking that maybe I could treat variety as subject? If not, I guess it woud be best to use genmod if my data has only fixed effects, and especially if some of my dependent variables can only take values that go on a scale from 1 to 5. That way I could use a beta or binomial distribution, right?

Thanks!

Caroline

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

If your dependent variable Y is always greater than zero, you could try GAMMA distribution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you Ksharp! So do think the gamma distribution will be more appropiate for values of 1 to 5 with half values like 1.5?

Thank you!

Caroline

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Nope. Gamma distribution is for any positive Y value,no matter it is 1 or 1.5 .

And as Jiltao said if your Y has only 1-5 five value,you could also try fit a logistic/multinomial / ordinal regression.

proc logistic ....

model y=...../ link=clogit;

run;

And as Jiltao said if your Y has only 1-5 five value,you could also try fit a logistic/multinomial / ordinal regression.

proc logistic ....

model y=...../ link=clogit;

run;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Ok, thank you so much for your reply! What if my dependent var is an ordinal scale that goes from 0 to 5 but where I also have half values of 1.5 for example? Can I still use the multinomial distribution?

Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Yes. you can.

/*y has value 1 ,1.5, 2,3*/ proc logistic .... model y=...../ link=clogit; run;

I noticed that your data could be formed by contingency table, you also could try PROC CATMOD to do Ordianl Logtisc Model.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you so much for your great suggestions!

So since I have different types of response variables, the most appropiate procedures will be as follow:

For continuous (measures) I would use proc genmod (normal or gamma dist).

For binary (0/1 or 0/100) I would use proc logistic.

For multinomial (scales; 0, 1, 1.5, 2, 2.5, 3) I would use proc logistic.

For ordinal (fruit browning; 0=no browning, 1=mild, 2=severe) I would use proc catmod (is this procedure only for ordinal data?).

Does it sounds reasonably to you? Also, how can I specify in proc logistic if my response var is binary or multinomial?

Thank you very much!

Caroline

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

"For multinomial (scales; 0, 1, 1.5, 2, 2.5, 3) I would use proc logistic.

For ordinal (fruit browning; 0=no browning, 1=mild, 2=severe) I would use proc catmod (is this procedure only for ordinal data?)."

Multinomial logistic model has two type of model.

One is for non-ordianl variable like : color: red,green,blue , you need to use link function GLOGIT.

/*y is non-ordinal*/

proc logistic ....

model color=...../ link=glogit;

run;

Another is for ordianl variable like : scale: 1,2,3, you need to use link function CLOGIT.

/*y is ordinal*/

proc logistic ....

model scale=...../ link=clogit;

run;

" I would use proc catmod (is this procedure only for ordinal data?)."

Nope. PROC CATMOD is specially designed for contingency table.

Sine your data can be formed by contingency table,you can use PROC CATMOD to model your data for LOGISTIC model or ANOVA model (check the code I showed above).

"how can I specify in proc logistic if my response var is binary or multinomial?"

That is easy ,just don't specify LINK function,SAS would automatically check Y and suite the right model for you. Like:

proc logistic ....

model y=.....;

run;

You will find out which model you are using in OUTPUT.

BTW,

If Y is binary variable like: 0,1 you need specify LINK=logit :

/*y is binary variable*/

proc logistic ....

model scale=...../ link=logit;

run;

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

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.