| To: | <yiwu21111958@yahoo.com>, <s-news@wubios.wustl.edu> |
|---|---|
| Subject: | Re: Names of coefficients in GLM |
| From: | <Bill.Venables@csiro.au> |
| Date: | Fri, 25 Jan 2008 16:08:27 +1000 |
| References: | <861410.84640.qm@web57112.mail.re3.yahoo.com> |
| Thread-index: | Ache7B4KHg7ZzUqhS0G50icpg7BBIgAKxFhQ |
| Thread-topic: | [S] Names of coefficients in GLM |
|
Your question suggest to me a number of
misunderstandings.
'Region1' in this ourput, does not refer to any
particular region at all, but rather to the first contrast between regions that
the model has used in the fitting. Likewise 'Region2' is the second
helmert contrast (according to the default).
If you want a separate intercept for each level of
Region, that is possible to some extent, and easy here.
dat <- data.frame(Number =
c(1,2,2,4,5,4,12,15,13),
Region =
c(rep("South",3),
rep("West",3),
rep("North",3)),
X1 =
c(c(1,2,3),c(2,3,2),c(3,4,5)))
fit <- lm(Number ~ X1 + Region - 1, data = "" ## why use 'glm'?? summary(fit,cor=F) will give
you an equivalent fit to the model you fitted, but with more interpretable and
better labelled coefficients.
Alternatively you can set
options(contrasts =
c("contr.treatment", "contr.poly"))
for
example, and then
fit <- lm(Number
~ X1 + Region, data = "">
Will get
you labelled coefficients, all right, but they may not mean quite what you think
they mean. You need to be careful in this game. Things are not
always as the seem at first glance.
Bill
Venables
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Names of coefficients in GLM, yiwu ye |
|---|---|
| Next by Date: | sorting a dataframe, Data Analytics Corp. |
| Previous by Thread: | Names of coefficients in GLM, yiwu ye |
| Next by Thread: | sorting a dataframe, Data Analytics Corp. |
| Indexes: | [Date] [Thread] [Top] [All Lists] |