0

I have multiple variables, E1,E2,E3,E4,E5,E6 are non binary variables and G1-G26 are indicator variables (0 or 1) . How would I be able to find up to 3rd order interactions for a linear regression equation, without receiving NA results for the summary output. When I run the following I receive NA for p-vales and std error:

M_raw2 <- lm( Y ~ (E1+E2+E3+E4+E5+G1+G2+G3+G4+G5+G6+G7+G8+G9+G10+G11+G12+G13+G14+G15+G16+G17+G18+G19+G20+G21+G22+G23+G24+G25)^3, data=newef )

summary(M_raw2)
Ferdi
  • 4,882
  • 7
  • 42
  • 62
Jess
  • 19
  • 4
  • If you have a case of $p>n$ where $p$ is the number of the predictors and $n$ the sample size there are [methods](https://www.google.com/url?sa=t&source=web&rct=j&url=https://stats.stackexchange.com/questions/108614/regression-in-pn-setting-how-to-choose-regularization-method-lasso-pls-pc&ved=2ahUKEwjLpKzw4_3hAhUrMuwKHf2YALIQjjgwAXoECAkQAQ&usg=AOvVaw1Hn-J-MfbTReUbq-I2VjRi) that can cope with that condition and can estimate the parameters. –  May 02 '19 at 21:27
  • I added more information to my answer which was accepted by Jess but unfortunately, it was deleted and nobody can see it anymore. Don't know how to change that.. –  May 03 '19 at 14:52
  • 1
    This question may not be perfect, but the reasons to put on hold don't hold. This question is about statistics and doesn't focus on programming. Code and code results are mentioned as computation and computation results could be expressed in formulas. And the code doesn't work as expected due to a statistical problem, not a programming one. – Pere May 03 '19 at 19:18
  • And I agree that @stats.and.r 's answer added useful information to the question even when it was like the comment is now. We could disagree about whether accepting it was a good choice, but it shouldn't be deleted. – Pere May 03 '19 at 19:22

1 Answers1

8

You have 30 first order effects, 900 second order interactions and 27000 third order interactions. Total, nearly 28000 parameters to estimate. Unless the number of cases you have is larger than that, you won't be able estimate all parameters and a lot of them will be reported just as NA.

Pere
  • 5,875
  • 1
  • 13
  • 29