cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
Reinaldo
Level IV

How to run the repeated measures from a raw data

Hi JMP users,

I am novice in JMP and I need to run the repeated measures analysis with ANOVA from a raw data in JMP. For example, given the following data:

 

Subject     Test1     Test2     Test3     Test4

     1             8            5            7           9

     2             3            2            5           6

     3             1            0            4           3

     4             5            2            6           6

     5             2            3            8           5

     6             9           10           8          10

     7            10           7            9          10

     8             2            4            7           2

     9            10           3            4           6

    10            0            1            3           5

 

where each subject was submitted to those tests in different timepoints, how can I analyse it? 

 

If it is possible, tell me the steps in JMP to get it, please!

 

Thank you in advance.

~Rei
16 REPLIES 16
Reinaldo
Level IV

Re: How to run the repeated measures from a raw data

Hi everybody,

 

I followed the above solution, but I don't know why it didn't work, unfortunately.

 

I'd like to analyse some matters in one-way repeated-measures ANOVA such as

 

- Mauchly's Test of Sphericity,

- tests of within-subjects effects,

- multivariate tests (Pillai's trace, Wilks' lambda, Hotelling's trace and Roy's largest root),

- contrasts (e.g., level 1 (Test1) vs level 2 (Test2), level 2 (Test2) vs level 3 (Test3) and level 3 (Test3) vs level 4 (Test4)) and

- pairwise comparisons.

 

When I used Table => Stack, I combined all Test columns into one and then I couldn't run the procedure described on the Chapter "Fitting Multiple Response Models Response Specification", similar to the example of univariate and sphericity test (Dogs.jmp), which indicated to run MANOVA. Certainly, we find out more than one independent variables (i.e., drugs and dep1) in that example (i.e., Dogs.jmp), whereas there is only one (i.e., Subject) in that raw data aforementioned.

 

Furthermore, after reading the page about fitting linear models, as I could understand a little bit about the meaning of brackets in the Construct Model Effects dialog, when you use Subject[Test] it implies the Test predictor is a between-subjects variable, doesn't it? I think the Test should be a within-subjects variable because all Subjects participate in those tests. Am I correct?

 

If yes, I suppose I cannot do the Nested effect (i.e., Subject[Test]), but do something like Subject*Test, don't I?

 

Thank you in advance.

~Rei
julian
Community Manager Community Manager

Re: How to run the repeated measures from a raw data

Hi @Reinaldo,

As others have pointed out you have the option to analyze these data in a few different ways, a MANOVA (which is also where you will find univariate adjusted and unadjusted repeated measures), or a linear mixed effects model. To produce the Mauchly's Test of Sphericity, you will need to use the MANOVA personality in Analyze > Fit Model. For this, as you noticed, you will be using your data in wide/split form (dataset attached with script). Here's the set up in Fit Model: manova setup.png

 Then, in the MANOVA report, you will want to construct a response specification: Click "Choose Response" and select "Repeated Measures," and also check box for Univariate tests. Title your within-subject factor as you like:
RM-response.png

 

 

At the bottom of the report you will see your tests of the within-subject effect, as well as the Mauchly's Test of Sphericity. You can also specify other contrasts if you wish here, but you might enjoy the interface more when using a mixed model approach. 

 

To fit these data using a mixed model, first stack you data (dataset attached). Next, launch Analyze > Fit Model, and place your response as Y. Next, place your subject column as well as label (or whatever you called your factor when you stacked) in as model effects. Select Subject in the model effects, then click the red triangle next to attributes, and select Random. Subject MUST be marked as nominal in your data table otherwise this will return an incorrect analysis. You do not need to use Nest in this case -- subjects would only be nested inside of a between-subject variable, and in this example you have none. mixed.png

When you click Run, you will get what is an equivalent analysis (since you have no missing data) to the univariate unadjusted analysis output you found from the MANOVA personality. mixedoutput.png

However, one benefit of using this modeling personality is that the Red Triangle next to your factor (label in this case) has additional useful options, such as performing all pairwise comparisons, Tukey-HSD, and custom single and multi-degree of freedom contrasts using a simple control panel. 

 

To fit more complicated repeated measures models, you might check out the Full Factorial Repeated Measures Add-in, which also works for one-way repeated measures such as this, but as you can see these are not too difficult to set up. 

 

I hope this helps!

@julian

Reinaldo
Level IV

Re: How to run the repeated measures from a raw data

Hi @julian thank you very much for your didactic explanation & files! Excellent!

Initially, I thought the Subject should be added into the Construct Model Effects to run the Mauchly's Test of Sphericity, but when I added it, I got different result from the sphericity test. So, in this case I haven't to consider Subject as part of my analysis for sphericity test, but only the Test variables.

Furthermore, when I use stacked data, I should use Standard Least Squares rather than MANOVA because I have just one dependent variable. However, when I have a split data (one column for each output variable) then I should use MANOVA and the result will be the same as before.

I watched your video Analysis of Repeated Measures Designs in JMP and it is great! I could learn more about how to tabulate the data to get some multivariate tests (G-G test, H-F test, Pillai's trace, Wilks' lambda, Hotelling's trace and Roy's largest root). 

Regarding the Factorial Repeated-Measures design, does it work in JMP v.10? In addition, is it possible to do that analysis without that add-in?
Thank you!

 

PS: If I add the Subject in the Construct Model Effects dialog, the Mauchly's sphericity test changes the value as well as the F-statistic. Why didn't you consider the Subject as a within-subject variable in that dialog?

 

~Rei
julian
Community Manager Community Manager

Re: How to run the repeated measures from a raw data

Hi Rei,

The Add-in will run without any trouble in JMP 10. Also, everything the Add-in does is possible using the Fit Model dialog, it just takes more work to specify all the model effects and interactions with the random subject effect for complicated models. In the details section of the add-in page I describe how the add-in generates the model effects -- if you don't have the add-in, you can follow those steps in the Fit Model dialog for a model of any complexity. Also, it's worth noting that the model generated by the add-in is just one of many possible mixed models that could be appropriate (mixed models are very flexible). The random effect structure I picked to implement is one that will match traditional univariate repeated measures for a factorial design (assuming no missing data). As is the case with most things, JMP can do so, so much more; I encourage you to learn more about mixed models if you find that you're often modeling repeated measures data.

@julian

julian
Community Manager Community Manager

Re: How to run the repeated measures from a raw data

Hi @Reinaldo,

In response to your PS:

"PS: If I add the Subject in the Construct Model Effects dialog, the Mauchly's sphericity test changes the value as well as the F-statistic. Why didn't you consider the Subject as a within-subject variable in that dialog?"

 

Multivariate approaches to repeated measures involve forming contrasts across the repeated observations, the observations that are across columns in your split/wide dataset. "Subject" variance is handled implicitly by forming these contrasts within subject across the columns, and so subject variance does not need to be modeled any further. If you add subject in the model effects section when running a MANOVA, you are telling jmp, essentially, that there is a between-subject variable with as many levels as you have subjects, and you've measured each level just one time. So, not what you want to do. A basic rule to remember is that if you have a variable for which you have only one row of measurement(s) per level in your table (like subject in a split/wide table) you shouldn't use it in your model effects.

Reinaldo
Level IV

Re: How to run the repeated measures from a raw data

Great, @julian! I thought the Subject variable would have been considered as a between-subject if it was in the brackets only! So, that's another way to have a between-subject (it's alone in that dialog)! Thank you!

~Rei
julian
Community Manager Community Manager

Re: How to run the repeated measures from a raw data

For a MANOVA, any variable in the model effects section is treated as a between-subject variable. For a mixed model approach, between-subject variables are specified in the model effects section and then subject is marked as being nested inside of the between-subject variables (as a way to tell JMP that particular levels of the subject variable, that is, individuals, are measured at only one particular level of the between-subject variable).