全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
2692 3
2011-04-21
Estimate the market model:
r t = α + β r m + et, 1 ≤ t ≤ T,
rt is an individual stock price return, r m is S&P100 index as market returns. Both rt and rm are known. et is residual term. α is constant.

Test the null hypothesis that β = 1 against the alternative that β not = 1

请大侠多多指教啊。叩谢叩谢!如果用R的命令做这条题呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2011-4-21 09:08:53
> require(car)
> n <- 40
> beta <- 0.9
> rm <- rnorm(n)
> rt <- rm*beta+rnorm(n)
> res <- lm(rt~rm)
> linearHypothesis(res,'rm=1')
Linear hypothesis test

Hypothesis:
rm = 1

Model 1: restricted model
Model 2: rt ~ rm

  Res.Df    RSS Df Sum of Sq      F Pr(>F)
1     39 29.060                           
2     38 29.027  1  0.033358 0.0437 0.8356
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-4-21 09:27:36
谢谢大侠。
但我想问问这个题能否用UNIT ROOT测试。我以为是要看CRITICAL VALUE ,指P-VALUE的。
我很CONFUSED。请再说明一下你的例子,行吗。叩谢。


2# beatuxlee
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2011-4-21 11:09:44
> require(tseries)
> RW <- function(n=100,initial=0) {
+   x <- c(initial,rep(NA,n-1))
+   for(i in 2:n) x[i] <- x[i-1] + rnorm(1)
+   return(x)
+ }
> x <- RW()
> adf.test(x)

        Augmented Dickey-Fuller Test

data:  x
Dickey-Fuller = -2.086, Lag order = 4, p-value =
0.5409
alternative hypothesis: stationary
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群