I would like to extract all coefficients from the linear regression model. By default, the reference category coefficient is omitted, but I need it along with the other coefficients.
Consider the following data:
library(conjoint)
data(chocolate)
And this function:
Conjoint(x = cprof, y = cpref, z = clevn)
1 intercept 8,6849
2 milk -1,0891
3 walnut -0,7328
4 delicaties -0,9224
5 dark 2,7443
6 low -0,5709
7 average 0,1188
8 high 0,4521
9 paperback -0,0287
10 hardback 0,0287
11 light -0,1686
12 middle 0,1734
13 heavy -0,0048
14 little -0,6466
15 much 0,6466
Returns all coefficient values. I need to do this in a conventional regression model like lm or glm or whatever, also returning the p values, like this:
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.68487 0.12648 68.667 < 0.0000000000000002 ***
kind1 -1.08908 0.19815 -5.496 0.0000000462 ***
kind2 -0.73276 0.19815 -3.698 0.000226 ***
kind3 -0.92241 0.19815 -4.655 0.0000035497 ***
price1 -0.57088 0.15254 -3.743 0.000190 ***
price2 0.11877 0.17887 0.664 0.506777
packing1 -0.02874 0.11440 -0.251 0.801714
weight1 -0.16858 0.15254 -1.105 0.269272
weight2 0.17337 0.17887 0.969 0.332575
calorie1 -0.64655 0.11440 -5.652 0.0000000193 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
I need to return kind4, price3, packing2, weight3, calorie2, in this table above (includes p values), but I haven't found any way to do that.
- The coefficients would need to be together in this table.