Quantcast

Interpreting coefficients in linear models with interaction terms

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Interpreting coefficients in linear models with interaction terms

Katie Harrison
Hi,

I am trying to interpret the coefficients in the model: RateOfMotorPlay ~ TestNumber + Sex + TestNumber * Sex where there are thee different tests and Sex is (obviously) binary. My results are: Residuals:
   Min     1Q Median     3Q    Max
-86.90 -26.28  -7.68  22.52 123.74

Coefficients:
                 Estimate Std. Error t value Pr(>|t|)    
(Intercept)        29.430      6.248   4.710 4.80e-06 ***
TestNumber2        56.231      8.837   6.364 1.47e-09 ***
TestNumber3        75.972     10.061   7.551 1.82e-12 ***
SexM                7.101      9.845   0.721    0.472    
TestNumber2:SexM  -16.483     13.854  -1.190    0.236    
TestNumber3:SexM  -24.571     15.343  -1.601    0.111    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 40.97 on 188 degrees of freedom
Multiple R-squared: 0.3288, Adjusted R-squared: 0.3109
F-statistic: 18.42 on 5 and 188 DF,  p-value: 7.231e-15

I am looking for one number that will represent the significance of the interaction term. I was thinking of doing an F test comparing this model to one without the interaction. When I do this, I get a highly significant result. I am not exactly sure how to interpret this. In particular, it seems strange to me to have a significant interaction term without both independent variables being significant. Any advice would be highly appreciated.
Thanks!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interpreting coefficients in linear models with interaction terms

Rolf Turner-3

We don't do people's homework for them.

But since you seem to have put in at least a little bit of your
own effort .....  It is perfectly possible for there to be an interaction
without there being main effects.

Consider two factors A and B each with two levels.  Let mu_11 be
the population mean when A is at level 1 and B is at level 1, and so
on.

Suppose mu_11 = 1, mu_12 = -1, mu_21 = -1, and mu_22 = 1.

Then there are no main effects; A averages to 0, as does B.

But there is an elephant-ful of interaction.

     cheers,

         Rolf Turner

     cheers,

         Rolf Turner

On 01/13/2013 10:56 AM, theundergrad wrote:

> Hi,
>
> I am trying to interpret the coefficients in the model: RateOfMotorPlay ~
> TestNumber + Sex + TestNumber * Sex where there are thee different tests and
> Sex is (obviously) binary. My results are: Residuals:
>     Min     1Q Median     3Q    Max
> -86.90 -26.28  -7.68  22.52 123.74
>
> Coefficients:
>                   Estimate Std. Error t value Pr(>|t|)
> (Intercept)        29.430      6.248   4.710 4.80e-06 ***
> TestNumber2        56.231      8.837   6.364 1.47e-09 ***
> TestNumber3        75.972     10.061   7.551 1.82e-12 ***
> SexM                7.101      9.845   0.721    0.472
> TestNumber2:SexM  -16.483     13.854  -1.190    0.236
> TestNumber3:SexM  -24.571     15.343  -1.601    0.111
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>
> Residual standard error: 40.97 on 188 degrees of freedom
> Multiple R-squared: 0.3288, Adjusted R-squared: 0.3109
> F-statistic: 18.42 on 5 and 188 DF,  p-value: 7.231e-15
>
> I am looking for one number that will represent the significance of the
> interaction term. I was thinking of doing an F test comparing this model to
> one without the interaction. When I do this, I get a highly significant
> result. I am not exactly sure how to interpret this. In particular, it seems
> strange to me to have a significant interaction term without both
> independent variables being significant. Any advice would be highly
> appreciated.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interpreting coefficients in linear models with interaction terms

Peter Dalgaard-2

On Jan 12, 2013, at 23:33 , Rolf Turner wrote:

>
> We don't do people's homework for them.
>
> But since you seem to have put in at least a little bit of your
> own effort .....  It is perfectly possible for there to be an interaction
> without there being main effects.
>
> Consider two factors A and B each with two levels.  Let mu_11 be
> the population mean when A is at level 1 and B is at level 1, and so
> on.
>
> Suppose mu_11 = 1, mu_12 = -1, mu_21 = -1, and mu_22 = 1.
>
> Then there are no main effects; A averages to 0, as does B.
>
> But there is an elephant-ful of interaction.

Also note that coefficients for main effects in the present of interactions have a different interpretation, depending on the coding of contrasts. In the summary table you cite, the value 7.101 is actually the effect of Sex within TestNumber1 and the interaction terms are the differences between that effect and those of Sex within the other two groups. Only if the latter terms are set to zero, the coefficient for Sex becomes the Sex effect for all groups. (All assuming that you haven't been messing with options("contrasts"))

Best,
Peter D.


>
>    cheers,
>
>        Rolf Turner
>
>    cheers,
>
>        Rolf Turner
>
> On 01/13/2013 10:56 AM, theundergrad wrote:
>> Hi,
>>
>> I am trying to interpret the coefficients in the model: RateOfMotorPlay ~
>> TestNumber + Sex + TestNumber * Sex where there are thee different tests and
>> Sex is (obviously) binary. My results are: Residuals:
>>    Min     1Q Median     3Q    Max
>> -86.90 -26.28  -7.68  22.52 123.74
>>
>> Coefficients:
>>                  Estimate Std. Error t value Pr(>|t|)
>> (Intercept)        29.430      6.248   4.710 4.80e-06 ***
>> TestNumber2        56.231      8.837   6.364 1.47e-09 ***
>> TestNumber3        75.972     10.061   7.551 1.82e-12 ***
>> SexM                7.101      9.845   0.721    0.472
>> TestNumber2:SexM  -16.483     13.854  -1.190    0.236
>> TestNumber3:SexM  -24.571     15.343  -1.601    0.111
>> ---
>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>>
>> Residual standard error: 40.97 on 188 degrees of freedom
>> Multiple R-squared: 0.3288, Adjusted R-squared: 0.3109
>> F-statistic: 18.42 on 5 and 188 DF,  p-value: 7.231e-15
>>
>> I am looking for one number that will represent the significance of the
>> interaction term. I was thinking of doing an F test comparing this model to
>> one without the interaction. When I do this, I get a highly significant
>> result. I am not exactly sure how to interpret this. In particular, it seems
>> strange to me to have a significant interaction term without both
>> independent variables being significant. Any advice would be highly
>> appreciated.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: [hidden email]  Priv: [hidden email]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interpreting coefficients in linear models with interaction terms

David Winsemius

On Jan 12, 2013, at 5:00 PM, peter dalgaard wrote:

>
> On Jan 12, 2013, at 23:33 , Rolf Turner wrote:
>
>>
>> We don't do people's homework for them.
>>
>> But since you seem to have put in at least a little bit of your
>> own effort .....  It is perfectly possible for there to be an  
>> interaction
>> without there being main effects.
>>
>> Consider two factors A and B each with two levels.  Let mu_11 be
>> the population mean when A is at level 1 and B is at level 1, and so
>> on.
>>
>> Suppose mu_11 = 1, mu_12 = -1, mu_21 = -1, and mu_22 = 1.
>>
>> Then there are no main effects; A averages to 0, as does B.
>>
>> But there is an elephant-ful of interaction.
>
> Also note that coefficients for main effects in the present of  
> interactions have a different interpretation, depending on the  
> coding of contrasts. In the summary table you cite, the value 7.101  
> is actually the effect of Sex within TestNumber1 and the interaction  
> terms are the differences between that effect and those of Sex  
> within the other two groups. Only if the latter terms are set to  
> zero, the coefficient for Sex becomes the Sex effect for all groups.  
> (All assuming that you haven't been messing with options("contrasts"))

I will step over the line (or ellipse) that defines my professional  
credentials and say that one should never attempt the maneuver  
described in the subject line. Instead one should construct and  
compare the effect estimates. With R that is most compactly done with  
'predict' methods.

--
David.

> Best,
> Peter D.
>
>
>>
>>   cheers,
>>
>>       Rolf Turner
>>
>>   cheers,
>>
>>       Rolf Turner
>>
>> On 01/13/2013 10:56 AM, theundergrad wrote:
>>> Hi,
>>>
>>> I am trying to interpret the coefficients in the model:  
>>> RateOfMotorPlay ~
>>> TestNumber + Sex + TestNumber * Sex where there are thee different  
>>> tests and
>>> Sex is (obviously) binary. My results are: Residuals:
>>>   Min     1Q Median     3Q    Max
>>> -86.90 -26.28  -7.68  22.52 123.74
>>>
>>> Coefficients:
>>>                 Estimate Std. Error t value Pr(>|t|)
>>> (Intercept)        29.430      6.248   4.710 4.80e-06 ***
>>> TestNumber2        56.231      8.837   6.364 1.47e-09 ***
>>> TestNumber3        75.972     10.061   7.551 1.82e-12 ***
>>> SexM                7.101      9.845   0.721    0.472
>>> TestNumber2:SexM  -16.483     13.854  -1.190    0.236
>>> TestNumber3:SexM  -24.571     15.343  -1.601    0.111
>>> ---
>>> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
>>>
>>> Residual standard error: 40.97 on 188 degrees of freedom
>>> Multiple R-squared: 0.3288, Adjusted R-squared: 0.3109
>>> F-statistic: 18.42 on 5 and 188 DF,  p-value: 7.231e-15
>>>
>>> I am looking for one number that will represent the significance  
>>> of the
>>> interaction term. I was thinking of doing an F test comparing this  
>>> model to
>>> one without the interaction. When I do this, I get a highly  
>>> significant
>>> result. I am not exactly sure how to interpret this. In  
>>> particular, it seems
>>> strange to me to have a significant interaction term without both
>>> independent variables being significant. Any advice would be highly
>>> appreciated.
>>
>> ______________________________________________
>> [hidden email] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: [hidden email]  Priv: [hidden email]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
Alameda, CA, USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interpreting coefficients in linear models with interaction terms

Katie Harrison
This post was updated on .
In reply to this post by Katie Harrison
Hi,

I have very limited (one class and the rest self-taught) statistics background (I am a comparative biology major) working on an independent study. I think that I am beginning to understand:

The coefficient SexM is the slope estimate for TestNumber1. If I add the coefficients for the other two interaction terms to the coefficient of SexM, I will get the slope estimate for the other two tests.

How would I quantify the significance of the interaction and SexM in the model? If, as I have done previously and as David suggests, I look at three different models each using only one test, I can quantify the effect of SexM simply by looking at the associated p-value. If, however, I chose to look at the interaction model in order to reduce the number of tests conducted , I do not have one number to look at that quantifies the significance of sex or the interaction. I thought about doing two F-tests, one comparing this model to a model without interaction (to find the significance of the interaction) and one comparing this model to one with only TestNumber (to find the total significance of sex). When I do this, I get a p-value of 0.006 for the first test and 0.3 for the second. My understanding of this is that SexM is non-significant; however, the relationship between SexM and RateOfMotorPlay significantly changes with TestNumber. This seems strange to me, but I seem to be hearing that it is possible. If this is true, I think that reporting that sex is non-significant is adequate and I do not need to report anything about the interaction since my research question is related to the effect of sex, not the change in the effect of sex over time. Does this approach adequately address the issue of whether or not sex is related to RateOfMotorPlay?

Thank you all so much for you helpful responses!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Interpreting coefficients in linear models with interaction terms

David Winsemius

On Jan 12, 2013, at 7:28 PM, theundergrad wrote:

> Hi,
>
> I have very limited (one class and the rest self-taught) statistics
> background (I am a comparative biology major) working on an independent
> study.

The number of major issues of confusion in what follows suggest that this is a topic for which your training has inadequately prepared you. You really need to be talking to your advisor about getting some proper directed reading. If your advisor has not the proper training in this area he should direct you to someone in your institution who has that capability.

> I think that I am beginning to understand:
>
> The coefficient SexM is the slope estimate for TestNumber1.

It would only make sense to talk about a "slope estimate" if there were a continuous variable in the set of independent variables ... and there is not.

> If I add the
> coefficients for the other two interaction terms to the coefficient of SexM,
> I will get the slope estimate for the other two tests.

Not a specific enough statement from which I can extract meaning to judge truth or falsity even if you were talking about mean estimates.

>
> How would I quantify the significance of the interaction and SexM in the
> model? If, as I have done previously and as David suggests, I look at three
> different models each using only one test, I can quantify the effect of SexM
> simply by looking at the associated p-value.

No. You failed to comprehend what I wrote.

> If, however, I chose to look at
> the interaction model in order to reduce the number of tests conducted , I
> do not have one number to look at that quantifies the significance of sex or
> the interaction.

Exactly.

> I thought about doing two F-tests, one comparing this model
> to a model without interaction (to find the significance of the interaction)
> and one comparing this model to one with only TestNumber (to find the total
> significance of sex).


> When I do this, I get a p-value of 0.006 for the first
> test and 0.3 for the second. My understanding of this is that SexM is
> non-significant; however, the relationship between SexM and RateOfMotorPlay
> significantly changes with TestNumber.

Right. Sometimes there will be a "significant" interaction involving a "non-significant main effect".


> This seems strange to me, but I seem
> to be hearing that it is possible. If this is true, I think that reporting
> that sex is non-significant is adequate and I do not need to report anything
> about the interaction since my research question is related to the effect of
> sex, not the change in the effect of sex over time. Does this approach
> adequately address the issue of whether or not sex is related to
> RateOfMotorPlay?

It sounds as though you have missed the most interesting aspect. If the effect of sex varies between treatments, wouldn't that be of immense interest?

>
> Thank you all so much for you helpful responces

Please stop behaving as a typical Nabble user and learn to post context.

> --
> View this message in context: http://r.789695.n4.nabble.com/Interpreting-coefficients-in-linear-models-with-interaction-terms-tp4655365p4655390.html
> Sent from the R help mailing list archive at Nabble.com.
--

David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Loading...