chen jia
2010-Jul-07 22:16 UTC
[R] How do I test against a simple null that two regressions coefficients are equal?
Hi there,
I run two regressions:
y = a1 + b1 * x + e1
y = a2 + b2 * z + e2
I want to test against the null hypothesis: b1 = b2. How do I design the test?
I think I can add two equations together and divide both sides by 2:
y = 0.5*(a1+a2) + 0.5*b1 * x + 0.5*b2 * z + e3, where e3 = 0.5*(e1 + e2).
or just y = a3 + 0.5*b1 * x + 0.5*b2 * z + e3
If I run this new regression, I can test against the null b1 = b2 in
this regression. Is it an equivalent test as the original one? If
yes, how do I do that in R?
Alternatively, I think I can just test against the null:
correlation(y, x) = correlation(y, z), where correlation(. , .) is the
correlation between two random variables. Is this equivalent too? If
yes, how do I do it in R?
Thanks.
Best,
Jia
--
Ohio State University - Finance
248 Fisher Hall
2100 Neil Ave.
Columbus, Ohio 43210
Telephone: 614-292-2830
http://www.fisher.osu.edu/~chen_1002/
Charles C. Berry
2010-Jul-08 03:12 UTC
[R] How do I test against a simple null that two regressions coefficients are equal?
On Wed, 7 Jul 2010, chen jia wrote:> Hi there, > > I run two regressions: > > y = a1 + b1 * x + e1 > y = a2 + b2 * z + e2 > > I want to test against the null hypothesis: b1 = b2. How do I design the test? >You are testing a non-nested hypothesis, which requires special handling. The classical test is due to Hotelling, but see the references (and R code snippets) in this posting: http://markmail.org/message/egnowmdzpzjtahy7 (it is the merest coincidence that the above thread was initiated by Mark Leeds and that the URL is 'markmail' :-) ) HTH, Chuck> I think I can add two equations together and divide both sides by 2: > y = 0.5*(a1+a2) + 0.5*b1 * x + 0.5*b2 * z + e3, where e3 = 0.5*(e1 + e2). > or just y = a3 + 0.5*b1 * x + 0.5*b2 * z + e3 > > If I run this new regression, I can test against the null b1 = b2 in > this regression. Is it an equivalent test as the original one? If > yes, how do I do that in R? > > Alternatively, I think I can just test against the null: > correlation(y, x) = correlation(y, z), where correlation(. , .) is the > correlation between two random variables. Is this equivalent too? If > yes, how do I do it in R? > > Thanks. > > Best, > Jia > > -- > Ohio State University - Finance > 248 Fisher Hall > 2100 Neil Ave. > Columbus, Ohio 43210 > Telephone: 614-292-2830 > http://www.fisher.osu.edu/~chen_1002/ > > ______________________________________________ > R-help at r-project.org 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. >Charles C. Berry (858) 534-2098 Dept of Family/Preventive Medicine E mailto:cberry at tajo.ucsd.edu UC San Diego http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901
markleeds at verizon.net
2010-Jul-08 03:26 UTC
[R] How do I test against a simple null that two regressions coefficients are equal?
wow chuck. you really know how to dig up the archives. I don't know if
it's
exactly relevant for what the OP is asking but i did use the
( or atleast a )? paper by hotelling and it was titled "the selection
of
variates for use in prediction with some comments on the general problem of
nusiance parameters. annals of mathematical statistics, 11, 271-283. joseph
lucke is not in that sequence of emails but I think he also helped me track
down relevant literature on it so credit goes to him also.
On Jul 7, 2010, Charles C. Berry <cberry at tajo.ucsd.edu> wrote:
On Wed, 7 Jul 2010, chen jia wrote:
> Hi there,
>
> I run two regressions:
>
> y = a1 + b1 * x + e1
> y = a2 + b2 * z + e2
>
> I want to test against the null hypothesis: b1 = b2. How do I design
the
test?
>
You are testing a non-nested hypothesis, which requires special handling.
The classical test is due to Hotelling, but see the references (and R code
snippets) in this posting:
http://markmail.org/message/egnowmdzpzjtahy7
(it is the merest coincidence that the above thread was initiated by Mark
Leeds and that the URL is 'markmail' :-) )
HTH,
Chuck
> I think I can add two equations together and divide both sides by 2:
> y = 0.5*(a1+a2) + 0.5*b1 * x + 0.5*b2 * z + e3, where e3 = 0.5*(e1 +
e2).
> or just y = a3 + 0.5*b1 * x + 0.5*b2 * z + e3
>
> If I run this new regression, I can test against the null b1 = b2 in
> this regression. Is it an equivalent test as the original one? If
> yes, how do I do that in R?
>
> Alternatively, I think I can just test against the null:
> correlation(y, x) = correlation(y, z), where correlation(. , .) is the
> correlation between two random variables. Is this equivalent too? If
> yes, how do I do it in R?
>
> Thanks.
>
> Best,
> Jia
>
> --
> Ohio State University - Finance
> 248 Fisher Hall
> 2100 Neil Ave.
> Columbus, Ohio 43210
> Telephone: 614-292-2830
> http://www.fisher.osu.edu/~chen_1002/
>
> ______________________________________________
> R-help at r-project.org 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.
>
Charles C. Berry (858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/ La Jolla, San Diego 92093-0901
______________________________________________
R-help at r-project.org 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.
markleeds at verizon.net
2010-Jul-08 14:51 UTC
[R] How do I test against a simple null that two regressions coefficients are equal?
hi: no. it's not the same. if you read the paper that I referenced last
night, that explains how to do the following? test :
Ho: R2 = R1
H1: R2 != R1
that's a different test from what you did but i think it's what you
want.
On Jul 8, 2010, chen jia <chen_1002 at fisher.osu.edu> wrote:
Thanks, Chuck. I am reading the references, which are helpful.
Just to understand what I have done wrong here,
I proposed an alternative testing strategy:
I run regressions y = a3 + b1 * x + b2 * z + e3 and test alternative
hypothesis b1 != b2 against the null hypothesis b1 = b2 in this
equation.
Is it this the same test as
y = a1 + b1*x + e1
y = a2 + b2*x + e2
test alternative hypothesis b1 != b2 against null hypothesis b1 = b2.
Best,
Jia
On Wed, Jul 7, 2010 at 11:12 PM, Charles C. Berry <cberry at
tajo.ucsd.edu>
wrote:
> On Wed, 7 Jul 2010, chen jia wrote:
>
>> Hi there,
>>
>> I run two regressions:
>>
>> y = a1 + b1 * x + e1
>> y = a2 + b2 * z + e2
>>
>> I want to test against the null hypothesis: b1 = b2. ? How do I
design
the
>> test?
>>
>
> You are testing a non-nested hypothesis, which requires special
handling.
>
> The classical test is due to Hotelling, but see the references (and R
code
> snippets) in this posting:
>
> ? ? ? ? http://markmail.org/message/egnowmdzpzjtahy7
>
> (it is the merest coincidence that the above thread was initiated by
Mark
> Leeds and that the URL is 'markmail' :-) )
>
> HTH,
>
> Chuck
>
>
>> I think I can add two equations together and divide both sides by
2:
>> y = 0.5*(a1+a2) + 0.5*b1 * x + 0.5*b2 * z + e3, where e3 = 0.5*(e1
+
e2).
>> or just y = a3 + 0.5*b1 * x + 0.5*b2 * z + e3
>>
>> If I run this new regression, I can test against the null b1 = b2
in
>> this regression. ? Is it an equivalent test as the original one?
If
>> yes, how do I do that in R?
>>
>> Alternatively, I think I can just test against the null:
>> correlation(y, x) = correlation(y, z), where correlation(. , .) is
the
>> correlation between two random variables. Is this equivalent too?
If
>> yes, how do I do it in R?
>>
>> Thanks.
>>
>> Best,
>> Jia
>>
>> --
>> ? ? ? ? ? ? ? ? ? ? ? ? Ohio State University - Finance
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 248 Fisher Hall
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2100 Neil Ave.
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? Columbus, Ohio ? 43210
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? Telephone: 614-292-2830
>> ? ? ? ? ? ? ? ? ? ? ?
http://www.fisher.osu.edu/~chen_1002/
>>
>> ______________________________________________
>> R-help at r-project.org 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.
>>
>
> Charles C. Berry ? ? ? ? ? ? ? ? ? ? ? ? ? ? (858)
534-2098
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Dept
of
Family/Preventive
> Medicine
> E mailto:cberry at tajo.ucsd.edu ? ? ? ? ? ? ? UC San Diego
> http://famprevmed.ucsd.edu/faculty/cberry/ ? La Jolla, San Diego
92093-0901
>
>
>
--
Ohio State University - Finance
248 Fisher Hall
2100 Neil Ave.
Columbus, Ohio 43210
Telephone: 614-292-2830
http://www.fisher.osu.edu/~chen_1002/
______________________________________________
R-help at r-project.org 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.