全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件
1065 1
2019-09-29
悬赏 10 个论坛币 未解决

> x=c(rep(1,5),rep(2,5))

> x1=as.factor(x)

> e=rnorm(10,0,3)

> y=4*x+e

> fit=lm(y~x1)

> summary(fit)

Call:

lm(formula = y ~ x1)

Residuals:

    Min      1Q Median      3Q       Max

-4.7426 -2.4395 0.5468 2.1125       5.0009

Coefficients:

            Estimate Std. Error t value Pr(>|t|)   

(Intercept)   5.399     1.514     3.565 0.00734 *

x12           3.173     2.142     1.482 0.17670 ***

- - -

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’   0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.386 on 8 degrees of freedom

Multiple R-squared: 0.2153,   Adjusted R-squared: 0.1173

F-statistic: 2.195 on 1 and 8 DF, p-value: 0.1767

> fit=lm(y~x1-1)

> summary(fit)

Call:

lm(formula = y ~ x1 - 1)

Residuals:

    Min      1Q Median      3Q     Max

-4.7426 -2.4395 0.5468 2.1125     

Coefficients:

Estimate Std. Error t value Pr(>|t|)   

x11   5.399     1.514   3.565    x11   0.007345 *

x12   8.572     1.514   5.661    x12   0.000476 ***

---

Signif. codes:

0 ‘***’ 0.001 ‘**’ 0.01 ‘*’   0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 3.386 on 8 degrees of freedom

Multiple R-squared: 0.8484,   Adjusted R-squared: 0.8104

F-statistic: 22.38 on 2 and 8 DF, p-value: 0.0005289

>fit1=lm(y~x1,contrasts=list(X1=”contr.sum”))

Summary(fit1)

the question is what is summary(fit1)


二维码

扫码加我 拉你入群

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

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

全部回复
2019-10-1 15:41:05
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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