0

df is data with values from 1-10 for 14 different variables formatted as a dataframe with n observations with lots of NA values for each variable which is why I couldn't do a regular lm with multiple predictors.

Then I used an lapply in order to do a linear regression for each variable because an MLR returns too many errors

x = lapply(df[,-1], function(x) summary(lm(df$IV ~ x)))

this returns a large list made up of 13 elements that are all lists

is.recursive(x) = TRUE

then I try to use stargazer

stargazer(x)

returns error

Error in .summary.object$coefficients : $ operator is invalid for atomic vectors

how do i get rid of this error?

sschale
  • 5,168
  • 3
  • 29
  • 36
jmi
  • 43
  • 4

1 Answers1

0

Try removing the summary call so that x is a list of lm objects, not summary.lm objects.

sboysel
  • 631
  • 7
  • 17