lm(y~x), c("(Intercept)=0", "x=1"))
>> Linear hypothesis test
>>
>> Hypothesis:
>> (Intercept) = 0
>> x = 1
>>
>> Model 1: restricted model
>> Model 2: y ~ x
>>
>> Res.Df RSS Df Sum of Sq F Pr(>F)
>>
es.Df RSS Df Sum of Sq F Pr(>F)
1 10 10.6218
2 8 9.0001 21.6217 0.7207 0.5155
Jan
From: R-help on behalf of John <
miao...@gmail.com>
Date: Thursday, 2 August 2018 at 10:44
To: r-help
Subject: [R] F-test where the coefficients in the H_0 is nonzero
Hi,
I try
earHypothesis(lm(y~x), c("(Intercept)=0", "x=1"))
> > Linear hypothesis test
> >
> > Hypothesis:
> > (Intercept) = 0
> > x = 1
> >
> > Model 1: restricted model
> > Model 2: y ~ x
> >
> > Res.Df RSS Df Sum of Sq
Linear hypothesis test
>
> Hypothesis:
> (Intercept) = 0
> x = 1
>
> Model 1: restricted model
> Model 2: y ~ x
>
> Res.Df RSS Df Sum of Sq F Pr(>F)
> 1 10 10.6218
> 2 8 9.0001 2 1.6217 0.7207 0.5155
>
>
> Jan
>
> From: R
behalf of John
Date: Thursday, 2 August 2018 at 10:44
To: r-help
Subject: [R] F-test where the coefficients in the H_0 is nonzero
Hi,
I try to run the regression
y = beta_0 + beta_1 x
and test H_0: (beta_0, beta_1) =(0,1) against H_1: H_0 is false
I believe I can run the regression
This should do it:
> x <- rnorm(10)
> y <- x+rnorm(10)
> fit1 <- lm(y~x)
> fit2 <- lm(y~-1 + offset(0 + 1 * x))
> anova(fit2, fit1)
Analysis of Variance Table
Model 1: y ~ -1 + offset(0 + 1 * x)
Model 2: y ~ x
Res.Df RSS Df Sum of Sq F Pr(>F)
1 10 10.6381
Hi,
I try to run the regression
y = beta_0 + beta_1 x
and test H_0: (beta_0, beta_1) =(0,1) against H_1: H_0 is false
I believe I can run the regression
(y-x) = beta_0 +beta_1‘ x
and do the regular F-test (using lm functio) where the hypothesized
coefficients are all zero.
Is
7 matches
Mail list logo