1
$\begingroup$

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)
$\endgroup$
  • $\begingroup$ If you have a case of $p>n$ where $p$ is the number of the predictors and $n$ the sample size there are methods that can cope with that condition and can estimate the parameters. $\endgroup$ – stats.and.r May 2 at 21:27
  • $\begingroup$ 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.. $\endgroup$ – stats.and.r May 3 at 14:52
  • 1
    $\begingroup$ 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. $\endgroup$ – Pere May 3 at 19:18
  • $\begingroup$ 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. $\endgroup$ – Pere May 3 at 19:22
7
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.