简体   繁体   English

如何绘制图形以检查重要预测变量以何种方式影响我的结果变量?

[英]How can I graph to check in what way a significant predictor is effecting my outcome variable?

How can create a visual to see how time of day effected morality levels? 如何创建视觉效果来查看一天中的时间如何影响道德水平? time of day is a 1/2 variable and morality was measured by a scale. 一天中的时间是1/2变量,道德是通过量表衡量的。

Reg2<-lm(Morality~TimeofDay,data=Data316b)
summary(Reg2)

Call:
lm(formula = Morality ~ TimeofDay, data = Data316b)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.43214 -0.48304 -0.06607  0.47589  1.21786 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   3.5500     0.1915  18.539   <2e-16 ***
TimeofDay     0.4821     0.1915   2.107   0.0418 *

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

Residual standard error: 0.6633 on 38 degrees of freedom
  (3 observations deleted due to missingness)
Multiple R-squared:  0.1046,    Adjusted R-squared:  0.081 
F-statistic: 4.438 on 1 and 38 DF,  p-value: 0.04181

I think you want 我想你要

plot(Morality~TimeofDay,data=Data316b)
Reg2 <- lm(Morality~TimeofDay,data=Data316b) summary(Reg2)
abline(Reg2)

or: 要么:

library("ggplot2")
ggplot(Data316b,aes(TimeofDay,Morality))+
   geom_point() + geom_smooth(method="lm")

PS are you really measuring morality [sic] as a function of time-of-day, or is it mortality that's changing?? PS:您是否真的根据一天中的时间来衡量道德[原文如此],还是死亡率正在改变?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何检查 R 在 GEE 分析(使用 geepack)中用作我的二分结果的参考水平? - How do I check what R used as reference level for my dichotomous outcome in a GEE analysis (using geepack)? 如何矢量化提取重要的预测变量? - How to vectorize extracting significant predictor variables? 如何在 aov() 分析中从我的预测变量中排除缺失数据? - How do I exclude missing data from my predictor variable in an aov() analysis? 对连续的预测变量进行分类并计算二进制结果的比例 - Categorize a continuous predictor variable and calculate proportion of binary outcome 如何使用 tidymodels 在我的结果变量中设置哪个级别是“事件”? - How do I set which level is the “event” in my outcome variable using tidymodels? R:如何在 if 语句中设置 2 个结果 - R: how can I set 2 outcome in if statement 有没有一种方法可以将回归中的重要变量放入图表中? - Is there a way that I can put into a barplot the significant variables from regression? 有没有办法可以使用 RStudio 将日志网格线添加到我的图表中? - Is there a way I can add log gridlines to my graph with RStudio? 无法在我的条形图上放置正确的重要值顺序(emmeans_test 重新排列因素) - Can't place correct order of significant values over my bar graph (emmeans_test rearranges factors) 如何仅为一种结果类型计算新数据框? - How can I calculate a new dataframe only for one outcome type?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM