The response variable needs to be a factor variable. So try
as.factor(OPTUNITS)
in the formula. I would also start with a smaller model using a smaller
number of covariates.
Kosuke
On Wed, 31 Jan 2007, Saleem Shaik wrote:
Dear Kosuke,
Thanks for the pointing the minor error but with a major impact of
unable to run the model. Sorry to bug you, but the model does not seem
to iterate or converage and provides with the following error.
*************************************************************************
# Ordered Logit Model OPTUNITS coded as
1,2,3,.....,9
library(Zelig)
Loading required package: MASS
Loading required package: boot
##
## Zelig (Version 2.7-5, built: 2006-12-25)
## Please refer to
http://gking.harvard.edu/zelig for full
documentation
## or help.zelig() for help with commands and models supported by
Zelig.
##
z.out <- zelig(OPTUNITS ~ FYBAR + MHAST1 +
MHASS1 + MHASR1 + FABAR1 +
FP65BAR + ACTUALS + D_PRAC + ST_DUM2 + ST_DUM3 + ST_DUM4
+ ST_DUM5 +
ST_DUM6, model = "ologit", data = example.dat)
Error in function (formula, data, weights, start, ..., subset,
na.action, :
response must be a factor
*************************************************************************
I have estimated this model in SAS and STATA and I am trying to
replicate in R. Could you provide you suggestions to be able to run
this model in R and I have attached the R code and SAS xport dataset.
Thanks
Saleem
**********************************************
Saleem Shaik, Ph.D
215 E Lloyd-Ricks, West Wing
Dept of Agricultural Economics,
Mississippi State University
Mississippi State, MS 39762-5187
Phone: (662) 325 7992 (Off)
(662) 615 3886 (Res)
Fax: (662) 325 8777
Email: shaik(a)agecon.msstate.edu
**********************************************
It is neither wealth nor splendor, but
tranquility and occupation, which gives
happiness.-- Jefferson
>> Kosuke Imai <kimai(a)Princeton.Edu>
01/31/07 2:34 PM >>>
It should be
library(Zelig)
not
library(zelig)
hope this helps.
Kosuke
-----------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
http://imai.princeton.edu
-----------------------------------------------------
On Wed, 31 Jan 2007, Saleem Shaik wrote:
Thank you for the reference. I tried to estimate
the ordered logit
model using the following commands (attached R code). In mydata
set
the LHS variable, OPTUNITS is coded as
1,2,3,.....,9. However, I
faced
with an error of unable to read ZELIG. Should I
download any package
to
run the model?
library(zelig)
Error in library(zelig) :
there is no package called 'zelig'
> z.out <- zelig(OPTUNITS ~ FYBAR + MHAST1 + MHASS1 + MHASR1 + FABAR
+
FP65BAR, model = "ologit", data =
example.dat)
Error: could not find function "zelig"
I could have sent the data file but it is large. If you want me to
send the data file I can send you the same in the next email.
Thanks, Saleem
**********************************************
Saleem Shaik, Ph.D
215 E Lloyd-Ricks, West Wing
Dept of Agricultural Economics,
Mississippi State University
Mississippi State, MS 39762-5187
Phone: (662) 325 7992 (Off)
(662) 615 3886 (Res)
Fax: (662) 325 8777
Email: shaik(a)agecon.msstate.edu
**********************************************
It is neither wealth nor splendor, but
tranquility and occupation, which gives
happiness.-- Jefferson
>> Kosuke Imai <kimai(a)Princeton.Edu>
01/31/07 12:14 PM >>>
You can use Zelig for ordered logit:
http://gking.harvard.edu/zelig/docs/_TT_ologit_TT__Ordinal.html
If you are interested in multinomial probit (or ordered multinomial
probit), then you need to use MNP:
http://imai.princeton.edu/research/MNP.html (see JSS paper for an
example).
Kosuke
-----------------------------------------------------
Kosuke Imai Office: Corwin Hall 041
Assistant Professor Phone: 609-258-6601
Department of Politics eFax: 973-556-1929
Princeton University Email: kimai(a)Princeton.Edu
Princeton, NJ 08544-1012
http://imai.princeton.edu
-----------------------------------------------------
On Wed, 31 Jan 2007, Saleem Shaik wrote:
Dear Imai,
Does zelig or MNP estimate the orderd logit and ordered probit
model?
If so could you provide the web link of an
example that estimates
the
ordered logit and probit model.
Thanks, Saleem
**********************************************
Saleem Shaik, Ph.D
215 E Lloyd-Ricks, West Wing
Dept of Agricultural Economics,
Mississippi State University
Mississippi State, MS 39762-5187
Phone: (662) 325 7992 (Off)
(662) 615 3886 (Res)
Fax: (662) 325 8777
Email: shaik(a)agecon.msstate.edu
**********************************************
It is neither wealth nor splendor, but
tranquility and occupation, which gives
happiness.-- Jefferson
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options: