Displaying 3 results from an estimated 3 matches for "contrast_coding".
2012 Jul 27
1
Understanding the intercept value in a multiple linear regression with categorical values
Hi!
I'm failing to understand the value of the intercept value in a
multiple linear regression with categorical values. Taking the
"warpbreaks" data set as an example, when I do:
> lm(breaks ~ wool, data=warpbreaks)
Call:
lm(formula = breaks ~ wool, data = warpbreaks)
Coefficients:
(Intercept) woolB
31.037 -5.778
I'm able to understand that the value of
2013 Feb 08
1
Contrasts for a data
Hi,
I am using a data called Rail in the nlme package. The data contains two
variables: Rail and Travel.
>Rail
Grouped Data: travel ~ 1 | Rail
Rail travel
1 1 55
2 1 53
3 1 54
4 2 26
5 2 37
6 2 32
7 3 78
8 3 91
9 3 85
10 4 92
11 4 100
12 4 96
13 5 49
14 5 51
15 5 50
16 6 80
2010 Oct 14
1
Regression with groups and nested sub-groups
I have the following formula for a linear model:
z <- lm(y~x + factor(a) + factor(b), data=NT2010)
where a (groups) and b (Sub-groups) are categorical variables (factors), x
is a continuous covariate, and y the response variable. Since b is nested
within a, the formula can also be written as:
z <- lm(y~x + factor(a) + factor(a)/factor(b), data=NT2010)
and the same output is achieved