I am getting different results from lmPerm
based on the order in which I enter the variables in the function call.
For example, placing NCF.pf
before TotalProperties
yields the following:
pfit <- lmp(NetCashOps ~ NCF.pf + TotalProperties, data = sub.pm, subset = Presence == 1)
summary(pfit)
...
Coefficients:
Estimate Iter Pr(Prob)
NCF.pf 4.581e-01 51 1
TotalProperties 5.246e+04 5000 <2e-16 ***
but, when I switch the order of the coefficients in the formula and place TotalProperties
before NCF.pf
, the p-value on NCF.pf
becomes significant
pfit2 <- lmp(NetCashOps ~ TotalProperties + NCF.pf, data = sub.pm, subset = Presence == 1)
summary(pfit2)
...
Coefficients:
Estimate Iter Pr(Prob)
TotalProperties 5.246e+04 5000 <2e-16 ***
NCF.pf 4.581e-01 5000 <2e-16 ***
Am I missing something? Why would the p-values be different just because I switched the order of the variables in the function call?
Update - Data Source and lm
Output (11/11/2016)
The data can be found on GitHub at this link.
When calling the standard lm
function twice (reversing the order of the variables on the second call), the p-values are identical (see below). Hence, unlike when using the lmPerm
function, the order of the variables doesn't matter with lm
.
fit1 <- lm(NetCashOps ~ NCF.pf + TotalProperties, data = sub.pm, subset = Presence == 1)
summary(fit1)
...
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.088e+05 2.258e+05 3.138 0.0019 **
NCF.pf 4.581e-01 1.112e-01 4.121 5.11e-05 ***
TotalProperties 5.246e+04 9.519e+03 5.511 8.76e-08 ***
fit2 <- lm(NetCashOps ~ TotalProperties + NCF.pf, data = sub.pm, subset = Presence == 1)
summary(fit2)
...
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.088e+05 2.258e+05 3.138 0.0019 **
TotalProperties 5.246e+04 9.519e+03 5.511 8.76e-08 ***
NCF.pf 4.581e-01 1.112e-01 4.121 5.11e-05 ***
Thanks!