r的相关语法
非常基本的问题,这是我第一次在R中编写语法。试图编写基本的相关语法。假设如下:x1(预测变量)和x2(潜在预测变量)将与y(结果变量)呈正相关,而不是x3(潜在的预测变量)。我该如何在r中写?
Very basic question, it's my first time writing syntax in R. Trying to write basic correlation syntax. Hypothesis is as follows: X1 (Predictor variable) and X2 (latent predictor variable) will be positively associated with Y (outcome variable), over and above X3 (latent predictor variable). How can I write this in R?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定您的统计排骨是什么,但是由R平方值衡量的纯粹相关将严格增加模型的添加变量。因此,如果这些变量存储在数据框架
df
中,则适合完整模型。使用
摘要(model_full)
查看模型的摘要统计信息。适合还原模型。这是更复杂的东西来的。要测试
x1
和x2
的值,您可能想要一个 f-Test 测试x1
和x2
的系数在统计上是否显着不同零(这是我解释“超越x3
”的方式)。要计算该测试,请使用Hope这会有所帮助!
Not sure what your statistics chops are, but pure the correlation as measured by the r-squared value will strictly increase with added variables to your model. So, if these variables are stored in data frame
df
,fits the full model. Use
summary(model_full)
to view summary statistics of the model.fits the reduced model. Here's where the more complicated stuff comes in. To test the value of
X1
andX2
, you probably want an F-test to test whether the coefficients onX1
andX2
are jointly statistically significantly different from zero (this is how I interpret 'above and beyondX3
'). To compute that test, useHope this helps!