Re: Comparing regression slopes?

• To: mathgroup at smc.vnet.net
• Subject: [mg43552] Re: Comparing regression slopes?
• From: Antti Penttilä <Antti.I.Penttila at helsinki.fi>
• Date: Fri, 19 Sep 2003 03:42:41 -0400 (EDT)
• Organization: University of Helsinki
• References: <bk9ksf\$64\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Jonathan Greenberg wrote:
> I have two continuous variables, X and Y that I regress with no intercept,
> so the equation ends up being:
>
> Y = MX
>
> My question is, does M significantly differ from some arbitrary value Z (Z
> <> 0 in this case)?  How do I do this in Mathematica?  Is there someplace I
> can just type in my expected Z and have Mathematica spit out a p-value?

An idea:

You 'know' that your data obeys the model
y = z x + eps
where z is known constant and eps is the random error. Now write
y = z x + eps <=> y = z x + 0 x + eps <=> y - z x = 0 x + eps
<=> y' = 0 x + eps
where new variable y' = y - z x.

If you now do the regression analysis to the new model y',x:
y' = b x + eps
and if you were rigth with your assumption of z, then b ~ 0, and that is what
the standard tests are testing for. So, in Mathematica

>Needs[ "Statistics`LinearRegression`"]
>y = {...};
>x = {...};
>z = .;
>yy = y - x;
>Regress[ Transpose[{x,yy}], {xx}, xx, IncludeConstant->False]

will give you the P-value you are looking for (hopefully).

--
Antti Penttilä           Antti.I.Penttila at helsinki.fi

```

• Prev by Date: Re: Evaluate one notebook from within another
• Next by Date: Re: Re: Fills in StackGraphics ?
• Previous by thread: Re: Comparing regression slopes?
• Next by thread: Re: Comparing regression slopes?