Suppose I have a formula y~x1+x2+I( (x1==x2)*x3 )and an estimate of a linear model
summary(lm(y~x1+x2+I( (x1==x2)*x3 ), data=some_data ))
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.6027 1.6069 2.242 0.0662 .
x1 1.8685 1.9769 0.945 0.3811
x2 2.6041 2.0286 1.284 0.2466
I((x1 == x2) * x3) 0.5666 1.5456 0.367 0.7265
Besides creating a new "data.frame", are there any methods to change the formula so that the pivot table becomes
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.6027 1.6069 2.242 0.0662 .
x1 1.8685 1.9769 0.945 0.3811
x2 2.6041 2.0286 1.284 0.2466
some_name 0.5666 1.5456 0.367 0.7265
source
share