Can you paste here the result from "traceback" command ? The following
works for me
fmls <- list(unem ~ gdp + capmob + trade,unem ~ gdp
+ capmob + trade)
lapply(fmls, function(fml) zelig(formula=fml, data=macro, model="ls",
cite=FALSE))
[[1]]
Call:
zelig(formula = fml, model = "ls", data = macro, cite = FALSE)
Coefficients:
(Intercept) gdp capmob trade
6.1813 -0.3236 1.4219 0.0199
[[2]]
Call:
zelig(formula = fml, model = "ls", data = macro, cite = FALSE)
Coefficients:
(Intercept) gdp capmob trade
6.1813 -0.3236 1.4219 0.0199
thanks,
Ferdi
Corey Dow-Hygelund wrote:
Hi,
I am running into a problem using lapply() on the method zelig().
Here is the list of models I am looking at,
model<- list()
model[[1]]<-as.formula("yield
~(pyrrolidone + teaHF + holdTime + holdTemp)^2 + I(pyrrolidone^2) + I(teaHF^2) +
I(holdTime^2) + I(holdTemp^2)")
model[[2]]<- as.formula("impurity ~
(pyrrolidone + teaHF + holdTime + holdTemp)^2 + I(pyrrolidone^2) + I(teaHF^2) +
I(holdTime^2) + I(holdTemp^2)")
model[[3]]<- as.formula("startMat ~
(pyrrolidone + teaHF + holdTime + holdTemp)^2 + I(pyrrolidone^2) + I(teaHF^2) +
I(holdTime^2) + I(holdTemp^2)")
Now, if I want to run a simple lm(), I use the following syntax with no errors,
y<-lapply(model, function(z) lm(z,
data=data1))
Or, I can explicitly reference MCMCregress without errors,
y<-lapply(model, function(z) MCMCregress(z,
data=data1, model="normal.bayes"))
But, I get the following when using zelig,
lapply(model, function(z) zelig(z, data=data1,
model="normal.bayes"))
Error in parse(text = x) : unexpected end of input in "+"
Any ideas on how to circumvent this issue?
Corey
-
Zelig Mailing List, served by Harvard-MIT Data Center
Send messages: zelig(a)lists.gking.harvard.edu
[un]subscribe Options:
http://lists.gking.harvard.edu/?info=zelig
Zelig program information:
http://gking.harvard.edu/zelig/
--
Ferdinand Alimadhi
Manager of Web Development and Statistical Programming
Harvard University
The Institute for Quantitative Social Science
(617) 496-0187
falimadhi(a)iq.harvard.edu