Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
解读R中的情节_R_Linear Regression - Fatal编程技术网

解读R中的情节

解读R中的情节,r,linear-regression,R,Linear Regression,我最近开始研究R,我试图看到两个定量变量F和test之间的关系 我的剧本是 library(dplyr) library(ggplot2) x = read.table("Input.txt", header = T) ggplot(data = x, aes(x = F, y = Test)) + geom_point(colour = "red") cor(x$F, x$Test) ggplot(data = x, aes(x = sqrt(F), y = sqrt(Test)))

我最近开始研究R,我试图看到两个定量变量F和test之间的关系 我的剧本是

library(dplyr)
library(ggplot2)

x = read.table("Input.txt", header = T)
ggplot(data = x, aes(x = F, y = Test)) +
  geom_point(colour = "red")
cor(x$F, x$Test)

ggplot(data = x, aes(x = sqrt(F), y = sqrt(Test))) +
  geom_point(colour = "red")+
  geom_smooth(method = "lm")

lmodel = lm(sqrt(Test) ~ sqrt(F), data = x)
结果见附件

summary(lmodel)

Call:
lm(formula = sqrt(Test) ~ sqrt(F), data = x)

Residuals:
    Min      1Q  Median      3Q     Max 
-3140.9 -2575.8 -1779.5  -146.2 18137.6 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)     2818       3910   0.721    0.479
sqrt(F)         2169       7668   0.283    0.780

Residual standard error: 5233 on 21 degrees of freedom
Multiple R-squared:  0.003796,  Adjusted R-squared:  -0.04364 
F-statistic: 0.08001 on 1 and 21 DF,  p-value: 0.78
我只是不理解R手册中关于摘要输出的内容

若我只看线性模型的p值,它的坏的和相关性告诉我们并没有线性关系

谁能帮我理解这一点

谁能说我的剧本是对的


您可以在以下链接中找到有关
摘要的更多信息

您的p值始终在0和1之间,其解释如下

  • 一个小的
    p值
    表明有强有力的证据反对你的无效假设

  • 一个大的
    p值
    表明反对无效假设的证据很弱

  • 此处的
    p值
    明显接近1。但不,这并不意味着你的模型不好

    大学统计教授斯蒂芬·蒂格勒说,异常高的p值表明数据与模型吻合得令人怀疑。。。也就是说,高的
    p值
    表明数据之间实际上没有相关性或关联。这有点像随机性的指标。表明你有多大的机会观察到像你已经拥有的那样的相关性


    此外,正如您所猜测的,这两个变量之间似乎没有关系。你的R平方统计提供了一个衡量模型拟合程度的指标。越接近1,越好

    非常感谢你。但这里的r2接近于0。这是否意味着模型不合适