• 手机版

    扫码体验手机版

  • 微信公众号

    扫码关注公众号

国内首家协议开发

软芯音视解码保护平台

在线
客服

发布
需求

在线
聊天

天盟
APP

天盟APP下载

关注
微信

微信扫一扫访问
顶部

R ,估计可能的线性模型

3. Estimate all possible linear models with two predictors and interaction. Use half your data. That is, regress `y` on the intercept only. Then regress `y` on `x1`. Then regress `y` on `x2`. Then on `x1` and `x2`. Then on `x1*x2`, then on `x1` and `x1*x2`, etc. This should result in 8 different models. All models have an intercept, but the first has only the intercept. Note: if you type `formula('y~X1*X2')` this will be expanded to `'y~X1+X2+X1*X2'`. You need to use `'y~I(X1*X2)'` to avoid this behavior.
Estimate all possible linear models with two predictors and interaction. Use half your data. That is, regress `y` on the intercept only. Then regress `y` on `x1`. Then regress `y` on `x2`. Then on `x1` and `x2`. Then on `x1*x2`, then on `x1` and `x1*x2`, etc. This should result in 8 different models. All models have an intercept, but the first has only the intercept. Note: if you type `formula('y~X1*X2')` this will be expanded to `'y~X1+X2+X1*X2'`. You need to use `'y~I(X1*X2)'` to avoid this behavior.

用两个预测因子和相互作用估计所有可能的线性模型。使用您的数据的一半。也就是说,只在截距上回归y。然后在x1上回归y。然后在x2上回归y。然后是x1和x2。然后在' x1*x2 '上,然后是' x1 '和' x1*x2 '等等,这将导致8个不同的模型。所有的模型都有一个截距,但第一个只有截距。注意:如果你输入“公式(y~X1*X2)”,那么它将被扩展到“y~X1+X2+X1*X2”。你需要使用“y~I(X1*X2)”来避免这种行为。





数据


#1.
```{r generate-function, echo=TRUE}
generate.lm

免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。

版权声明:作者保留权利,不代表天盟立场。

使用道具 举报

发新帖

发布任务需求已有1031167位用户正在使用天盟网服务

发布分类: *
任务预算: *
需求内容: *
手机号码: *
任务商家报价为
  • 预算价 :
  • 成交价 :
  • 完工期 :
  • 质保期 :

* 最终任务项目以服务商报价、双方协商为准!