ID X Y Ele Temp
1 50353 126.6333 51.73333 173.9 0.055024
2 50468 127.4500 50.25000 166.4 1.619074
3 50564 127.3500 49.43333 234.5 1.468917
4 50674 129.4333 48.56667 404.5 0.954324
5 50774 128.8333 47.70000 264.8 2.621272
6 50778 132.5333 47.66667 57.5 4.410369
myModel = lm(Temp ~ Ele + X + Y, data = myData)
summary(myModel)
Call:
lm(formula = Temp ~ Ele + X + Y, data = myData)
Residuals:
Min 1Q Median 3Q Max
-1.00352 -0.32245 -0.01634 0.39690 1.27065
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 27.8974176 5.0653852 5.507 3.76e-06
Ele -0.0053912 0.0005171 -10.425 3.97e-12
X 0.1243715 0.0423171 2.939 0.00588
Y -0.8286338 0.0377717 -21.938 < 2e-16
(Intercept) ***
Ele ***
X **
Y ***
---
Signif. codes:
0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5099 on 34 degrees of freedom
Multiple R-squared: 0.9383, Adjusted R-squared: 0.9328
F-statistic: 172.3 on 3 and 34 DF, p-value: < 2.2e-16
f = mySummary$fstatistic
p_value = pf(as.numeric(f[1]), as.numeric(f[2]), as.numeric(f[3]), lower.tail = FALSE)
lapse_rates = coef(myModel)[2]
f = summary(myModel)$fstatistic
f_statistic = f[1]
p_value = pf(as.numeric(f[1]), as.numeric(f[2]), as.numeric(f[3]), lower.tail = FALSE)
result = c(lapse_rates,f_statistic, p_value)
names(result) = c("lapse_rates","F-statistic","p-value")
print(result)
lapse_rates F-statistic p-value
-5.391219e-03 1.723034e+02 1.261248e-20
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!