Hi, I'm puzzled by the error message below:
> library(Zelig)
> z.out <- zelig(After ~ Variety * Before + Trt, model
= "normal", data = spray2)
> x.out <- setx(z.out, Trt = "Flint")
Error in seq.Date(along = object) : 'from' must be
specified
None of the variables in the model are date variables
(although three other variables in the data set are).
Can't find anything on how to specify 'from'.
Mikkel
BTW. How do I get to see the code for setx?
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options: http://lists.hmdc.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
On Fri, 19 Aug 2005, Igor Grigorovich wrote:
> Dear Dr. King,
>
>
> I was excited to find your package Zelig for Multinomial Logistic Regression for Dependent Variables with Unordered Categorical Values, which I used to model ecoregions as a function of geographic coordinates. Unfortunately, I was not able to complete my calculations due to the following error:
>
>
>
>
>
> Error in tfun(mu = mu, y = y, w = w, res = FALSE, eta = eta, extra) :
>
> NAs are not allowed in subscripted assignments
>
> In addition: Warning messages:
>
> 1: there are NAs here 3423 in: slot(family, "inverse")(eta, extra)
>
> 2: fitted values close to 0 or 1 in: tfun(mu = mu, y = y, w = w, res = FALSE, eta = eta, extra)
>
>
>
> When using help, I was suggested to check the option 'FOO(PKG)TITLE' in the (FOO, package = PKG), however I was not able to do so. Although R is a new environment for me, however I was able to use successfully other R package (mgcv). Perhaps this is not a software problem; my model possible cannot be converged.
>
>
>
> I would appreciate any your suggestions. Hopefully this feedback is of help,
>
>
>
> Yours sincerely,
>
>
>
> Igor Grigorovich
>
>
>
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options: http://lists.hmdc.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
Thanks to all, I have overcome my previous problem.
I'm writing now because I have data which doesn't fulfill the vglm requirement of being full-rank. Is there a way to fit a multinomial logit non full-rank model?
Thanks,
Alejandro
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
one way around it is to combine categories of your dep var, or to use x's withfewer distinctions.
Gary
-----Original Message-----
From: Alejandro Buren <aled38(a)yahoo.com.ar>
Date: Monday, Aug 15, 2005 6:13 pm
Subject: Re: [zelig] non full-rank models in mlogit
Dear Olivia,
thank you very much for the insight.
Actually my problem is that for certain combinations of the levels of the variables I have no observations, i.e. in the mexico example that's equivalent to not having an observation for "vote88=1", "pristr=1", "othcok=2","othsocok=2" Is there a way to deal with that?
Thanks
Alejandro
Olivia Lau <olau(a)fas.harvard.edu> escribió:
Dear Alejandro,
If your data isn't full-rank, it means that you have one of the following problems:
1) You have one or more perfectly collinear variables. (e.g., x2 = x3 + 4)
2) You have a variable that consists either entirely of NA values or 0s.
Some basic data checking (try summary(), is.na(), etc) will clear this up. See http://gking.harvard.edu/zelig/docs/Data_Sets.html for some guildelines.
Best,
Olivia
----- Original Message -----
From: Alejandro Buren
To: zelig(a)latte.harvard.edu
Sent: Monday, August 15, 2005 5:36 PM
Subject: [zelig] non full-rank models in mlogit
Thanks to all, I have overcome my previous problem.
I'm writing now because I have data which doesn't fulfill the vglm requirement of being full-rank. Is there a way to fit a multinomial logit non full-rank model? Thanks,
Alejandro
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)latte.harvard.edu
[un]subscribe Options: http://lists.hmdc.harvard.edu/?info=zelig
Zelig program information: http://gking.harvard.edu/zelig/
Hi everybody, I'd like to know if there is a way to set a priori the values for parameters of interest (e.g. to set pristr:1 = 0 in the example), and fit the model leaving the fixed parameters as they are (i.e. not estimating them)
Thanks again,
Alejandro
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
Dear Olivia and Kosuke,
thank you very much for your kindness.
mlogit is taking the base-line category exactly as I thought
it was doing it.
But my problem remains, since the output is
> z.out <- zelig(food ~ small + han + okl + tra, model = "mlogit", data = alligator)
> z.out
Call:
zelig(formula = food ~ small + han + okl + tra, model = "mlogit",
data = alligator)
Coefficients:
(Intercept):1 (Intercept):2 (Intercept):3 (Intercept):4 small:1 small:2 small:3 small:4 han:1 han:2 han:3
-0.6931 -13.4332 -13.4332 -13.4332 -0.2178 0.5949 -1.0014 -1.0256 1.7697 12.0783 12.6985
han:4 okl:1 okl:2 okl:3 okl:4 tra:1 tra:2 tra:3 tra:4
13.2221 2.5126 14.9878 14.5858 13.3380 1.0514 13.6991 13.5604 12.8731
Degrees of Freedom: 636 Total; 616 Residual
Residual Deviance: 418.9
Log-likelihood: -209.5
I assume that (for example) intercept1 refers to the intercept for the first level which is not the base-line category (invertebrate). If that is so,
and I plug these estimates in the calculus of the log likelihood yields Log-likelihood: -284.
Besides, the estimates are quite different from those reported by Agresti (2002):
AGRESTI (2002) mlogit
intercept Size Hancock Oklawaha Trafford intercept Size Hancock Oklawaha Trafford
Invertebrate -1.55 1.46 -1.66 0.94 1.12 Invertebrate -0.6931 -0.2178 1.7694 2.5126 1.0514
Reptile -3.31 -0.35 1.24 2.46 2.94 Reptile -13.433 0.5949 12.0783 14.9878 13.6991
Bird -2.09 -0.63 0.7 -0.65 1.09 Bird -13.433 -1.0014 12.6985 14.5858 13.5604
Other -1.9 0.33 0.83 0.01 1.52 Other -13.433 -1.0256 13.2221 13.338 12.8731
I believe I'm missing something really important here but I don't know what it is, could you please give me a hint?
Thanks a lot in advance,
Alejandro
--------------------------------------------------------------------------------
Dear Alejandro,
All models that take a factor response (mlogit, oprobit, ologit, etc) as
the dependent variable use the first level as the base case.
Now you ask: What's the first level? For a numeric vector, the first
level is the smallest level. For a vector of character strings, the first
level is the first string value in alphabetical order.
Best,
Olivia
On Thu, 11 Aug 2005, Alejandro Buren wrote:
> Dear all,
> I'm new to Zelig, I found it looking for a way to fit multinomial logit models with R.
> I still haven't been able to figure out how "mlogit" chooses the base-line category.
> I tried running an example I'm familiarized with (Alligator Food Choice Example, Ex 7.1.2
> from Agresti 2002 "Categorical Data Analysis"), but that didn't help me to understand how it is working.
> Could anyone help me out?
> I'm pasting the code to run the example.
> Any comment or help will be most appreciated,
>
>
> > alligator <- data.frame(
> food = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,4,5,5,5,5,5,5,5,5,1,1,1,1,1,1,1,2,3,4,4,4,5,5,5,5,5,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,4,5,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,5,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,4,5,5,5,5,5,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,5,5,5,5,5),
> small = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
> han = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
> okl = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
> tra = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
>
>
>
> > z.out <- zelig(food ~ small + han + okl + tra, model = "mlogit", data = alligator)
>
> --
> Alejandro Daniel Buren
> Graduate Student
> Memorial University of Newfoundland
> St. John's, Newfoundland A1B 3X9 Canada
>
> e-mail: aburen@xxxxxx
Dear all,
I'm new to Zelig, I found it looking for a way to fit multinomial logit models with R.
I still haven't been able to figure out how "mlogit" chooses the base-line category.
I tried running an example I'm familiarized with (Alligator Food Choice Example, Ex 7.1.2
from Agresti 2002 "Categorical Data Analysis"), but that didn't help me to understand how it is working.
Could anyone help me out?
I'm pasting the code to run the example.
Any comment or help will be most appreciated,
> alligator <- data.frame(
food = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,4,5,5,5,5,5,5,5,5,1,1,1,1,1,1,1,2,3,4,4,4,5,5,5,5,5,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,4,5,5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,4,5,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,4,5,5,5,5,5,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,5,5,5,5,5),
small = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
han = c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
okl = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
tra = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1))
> z.out <- zelig(food ~ small + han + okl + tra, model = "mlogit", data = alligator)
--
Alejandro Daniel Buren
Graduate Student
Memorial University of Newfoundland
St. John's, Newfoundland A1B 3X9 Canada
e-mail: aburen(a)mun.ca
Hi, everyone.
Since we so infrequently send out announcements, it's time for a little catching up. 8) A few quick things:
1) We've just bundled up a new release (version 2.3-2) that contains some significant bug fixes for censored data models (exponential, weibull, and lognormal), as well as incorporating improvements from previous releases (e.g., revising ReLogit and adding robust standard errors for most models). It should be available on CRAN later this week, but in the meanwhile, you can use install.packages("Zelig", CRAN = "http://gking.harvard.edu") to install it.
2) For those who will be in the Washington, D.C. area on Wednesday, August 31st: The Zelig team will hold a professional development course as part of the American Political Science Association Annual Meeting. We'll cover how Zelig fits into different theories of inference, how to use different models and options, and how to add your own models to Zelig. Email me (olau(a)fas.harvard.edu) for more information.
Please keep the suggestions coming in!
Best,
Kosuke, Gary, and Olivia