Advertisement

R语言的一元回归预测明年国家线

阅读量:

借助R语言构建一个回归模型,以预测明年教育学学术型硕士的国家分数线。

我的专业属于教育学类别。

数据框构建方法

复制代码
    gjx <- data.frame(
      year = c(2017,2018,2019,2020,2021,2022),
      grade = c(310,320,325,331,337,351)
    )
    gjx
    
    
      
      
      
      
      
    

拟合模型

复制代码
    fit1 <- lm(grade~year,data = gjx)
    anova(fit1)
    summary(fit1)
    
    
      
      
      
    

F=133.55, p=0.0003203, adjusted R-square=0.97
it seems our model works just fine

复制代码
    confint(fit1)
    
    
      
    

*the table below seems to be the 95% interval of the coefficient *

|2.5 %|97.5 %||
|--

全部评论 (0)

还没有任何评论哟~