0

I'm trying to run a hierarchal regression to see how three different dimensions (let's call them A, B, and C) collectively and independently account for the variance of the DV. The issue I'm running into, is that I have two different inventories of which I want to combine to equal the "C" dimension (example. shoe + flip flop = footwear). Below is the equation I tried running, but I'm noticing that the parentheses don't make a difference in the output. Is there a suggested way to input the regression code so that the "C" dimension is created from two variables?

reg <- lm(IASMHS80~ A + B, + (C1 + C2), data=mydatareg)
summary(reg)
Martin Gal
  • 16,640
  • 5
  • 21
  • 39
  • Maybe you want `reg <- lm(IASMHS80~ A + B +I (C1 + C2), data=mydatareg)` It would be more clear with a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output. – MrFlick Aug 20 '21 at 21:00
  • I guess the obvious trivial solution would be to create C first: IASMHS80$C <- IASMHS80$C1 + IASMHS80$C2 – SteveM Aug 20 '21 at 21:15

0 Answers0