楼主: tiexingxing
1064 1

[作业] 关于线性回归的一个题 [推广有奖]

  • 1关注
  • 1粉丝

已卖:6份资源

副教授

92%

还不是VIP/贵宾

-

威望
0
论坛币
1500 个
通用积分
1.1734
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1066 点
帖子
449
精华
0
在线时间
847 小时
注册时间
2009-10-27
最后登录
2024-3-6

楼主
tiexingxing 学生认证  发表于 2019-9-29 06:13:14 |AI写论文
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)


关键词:关于线性回归的一个题

沙发
xujingjun 发表于 2019-10-1 15:41:05

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-2-7 19:56