Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: "Repeated-measures" form of linear regression?

 From "Michael N. Mitchell" To statalist@hsphsun2.harvard.edu Subject Re: st: "Repeated-measures" form of linear regression? Date Fri, 17 Sep 2010 14:56:23 -0700

```Dear Pietro

```
This is a topic that I feel has received very little coverage... repeated measures models are usually conceptualized in an ANOVA framework and books usually discuss it in terms of Analysis of Variance (although it is just another form of a linear regression model). One exception is SAS for Linear Models by Ramon Littell, Walter W. Stroup, and Rudolf Freund. Chapter 8 showed the evolution of this model, culminating with a discussion of expressing it as a mixed model analysis (in Stata speak, xtmixed). Although the examples are shown in SAS, it is not overly hard to convert those examples into Stata. The next step up from that would be SAS for Mixed Models, Second Edition by Littell, Milliken, Stroup, Wolfinger, and Schabenberber. This provides even more details into how to apply mixed models in SAS (which can be converted into -xtmixed-). This might seem like a circuitous suggestion, but I think it is the most direct route to the kind of understanding that you are seeking. I hope it helps.
```
Best regards,

Michael N. Mitchell
Data Management Using Stata      - http://www.stata.com/bookstore/dmus.html
A Visual Guide to Stata Graphics - http://www.stata.com/bookstore/vgsg.html
Stata tidbit of the week         - http://www.MichaelNormanMitchell.com

On 2010-09-17 1.40 PM, Pietro Mazzoni wrote:
```
```Dear Statalist,

My question is not specific to Stata, but I am hoping that someone can at least point me to the topic of statistical testing on which I can do more reading to answer this question. I appreciate any suggestions.

My hypothesis, in a motor control experiment, is that there is a linear relationship between a perturbation (say, force F) and a response (say, lateral deviation D). I obtained data from several subjects who were tested at various levels of force and whose response was a particular deviation for each force pulse. I feel that it would be incorrect to perform a linear regression of D vs. F on the pooled data, because this would ignore within-subject correlations. I see this data as analogous to repeated-measures ANOVA, because multiple pairs of (F, D) were collected within each subject.  So my intuition tells me I should perform linear regression within each subject, and then somehow combine these results across the group, but I don't know what procedure might be the analog of rm-ANOVA for regression. One suggestion I got was to perform individual regressions within each subject and then average the values of the slopes and intercepts obtained to estimate slope and intercept
```
```
f!
```
```  or the group. But I am more interested in establishing whether there is a significant relationship at the group level (R square, p value for the group) than in determining the parameters of the regression, and I don't know how to combine the R squares or p values obtained for individual subjects.

Thanks in advance for any ideas.

Pietro
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```
```*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```