BookmarkSubscribe
Choose Language Hide Translation Bar

Re: SAS code in JMP?

Isadora,

I talked with Adam Morris about your question. Independently, I came up with the same results as him, even though I set the model up in a slightly different fashion. I liked his set up a bit better, so I'd use that one. Please let me know if you have additonal questions.

Don

bordini
Community Trekker

Re: SAS code in JMP?

@DonMcCormack Thank you very much for your response. 

 

Would you mind sharing your solution as well? I'd like to compare them, because I'm interested in learning more about coding in JMP and other approaches for my data.

 

Thank you!

 

Isadora

0 Kudos

Re: SAS code in JMP?

My solution is below:

Fit Model(
	Y( :Response ),
	Effects(
		:Treatment,
		:Week,
		:Treatment * :Week,
		:Year,
		:Treatment * :Year,
		:Week * :Year,
		:Treatment * :Week * :Year
	),
	Random Effects( :Rep[:Treatment, :Year] ),
	NoBounds( 1 ),
	Personality( "Mixed Model" ),
	Subject( :Treatment, :Year, :Rep ),
	Repeated Effects( :Week2 ),
	Repeated Structure( "AR(1)" ),
	Run( Variogram( AR1( 1 ) ) )
);

There are only two differences. For the additional random effect, I nested Rep in Year. I used Treatment, Year, and Rep to implicitly define Subject. I find Adam's approach of explicitly defining Subject more intuitively appealing, though.

bordini
Community Trekker

Re: SAS code in JMP?

 @DonMcCormack That is very helpful!

 

Thanks for sharing it with me, and for giving me your opinion on which solution is the best approach. I really appreciate that.

 

Isadora

0 Kudos

Re: SAS code in JMP?

Hi Isadora,

 

To share with others reading this thread, the proposed solution (from JMP Technical Support) is to create a new Subject column that is the concatenation of the 3 variables identifying the subjects (Treatment, Year, and Rep).

 

It is also necessary to create a continuous copy of the Week column for use as the Repeated variable.

 

JMP Pro cannot fit the exact same model as specified by the SAS Code (For AR(1) models, JMP nests the random effects in the subject variable).  However, JMP can fit the model omitting the Rep(Year) term.  The script below shows how one might set this up.

 

Thanks,

Adam

 

New Column("Subject", Character, Formula( :Treatment || ", " || Char( :Year ) || ", " || Char( :Rep ) ));
New Column("Week2", numeric, continuous, formula(:Week));    

Fit Model(
   Y( :response ),
   Effects(
       :Treatment,
       :Week,
       :Year,
       :Treatment * :Week,
       :Treatment * :Year,
       :Week * :Year,
       :Treatment * :Week * :Year
   ),
   Random Effects( :Treatment*:Year*:Rep ),
   Subject(:Subject),
   Repeated Effects( :Week2 ),
   Repeated Structure( "AR(1)" ),
   Personality( "Mixed Model" )
);
bordini
Community Trekker

Re: SAS code in JMP?

@adammorris , you have been so helpful!

 

Thank you so much for sharing your knowledge and all this good information! I appreciate that.

0 Kudos
bordini
Community Trekker

Re: SAS code in JMP?

Hi @adammorris and @DonMcCormack 

 
I would like to know if you could help me to understand a little better why you used only one term as a random effect. Is it because I'm allowed to use only one random term under Random Effects when I use AR1?
 
Thank you,
 
Isadora
0 Kudos
jiancao
Staff

Re: SAS code in JMP?

You can add more than one random effect in the analysis of repeated measures. However you will get a note saying “The repeated subject column has been nested in all random effects.”  See the screenshot below. I think that is why Adam suggested dropping Rep(Year) because it will nest in Treatment.

2019-06-12_13-27-10.png

Have you tried including two random effects? What have you seen?

bordini
Community Trekker

Re: SAS code in JMP?

@jiancao Thank you for your explanation.

 

Every time I include more than one random effects, I get "0"  for Estimate, Std Error (see scren shot) for one of the random effects. Why would that be? Is it because of the nesting?

 

Thank you for your help,

 

Isadora

0 Kudos
Highlighted
jiancao
Staff

Re: SAS code in JMP?

Yes, the random effect, Year(Subject), or whatever the first one, is the estimated between subject variation.