Linear regression of same outcome, similar number of covariates and one unique covariate in each model

后端 未结 1 1332
我在风中等你
我在风中等你 2021-01-14 14:32

I want to run linear regression for the same outcome and a number of covariates minus one covariate in each model. I have looked at the example on this page but could that d

1条回答
  •  悲哀的现实
    2021-01-14 14:57

    Following this example you could do this:

    lapply(1:3, function(i){
        lm(as.formula(sprintf("y ~ x%i + x4 + x5", i)), a)
    })
    

    0 讨论(0)
提交回复
热议问题