[R] Probit regression with limited parameter space

2012-01-31 Thread Sally Luo
Dear R helpers, I need to estimate a probit model with box constraints placed on several of the model parameters. I have the following two questions: 1) How are the standard errors calclulated in glm (family=binomial(link=probit)? I ran a typical probit model using the glm probit link and the

[R] How to draw a map of Europe?

2011-03-19 Thread Sally Luo
Hi R users, I need to draw a map of select European countries with country names shown on the map. Does anyone know how to do this in R? Also, is it possible to draw a historical map of European countries using R? Thanks a lot for your help. Maomao [[alternative HTML version

[R] if statement and truncated distribution

2010-10-25 Thread Sally Luo
Hi R helpers, I am trying to use the if statement to generate a truncated random variable as follows: if (y[i]==0) { v[i] ~ rnorm(1,0,1) | (-inf ,0) } if (y[i]==1) { v[i] ~ rnorm(1,0,1) | (0, inf) } I guess I cannot use | ( , ) to restrict the range of a variable in R. Could you let me know

[R] Problem using BRugs

2010-10-15 Thread Sally Luo
Hi R users, I am trying to call openbugs from R. And I got the following error message: ~ model is syntactically correct expected the collection operator c error pos 8 (error on line 1) variable ww is not

[R] Place constrictions on parameters when using Optim and MaxLik

2010-09-30 Thread Sally Luo
Hi R users, I am trying to restrct the range of two of the parameters in a maximization problem. Both parameters should be between -1 and 1. As far as I know, if I choose the estimation method =L-BFGS-B under Optim, I can restrict the parameter space. However, the L-BFGS-B always require

[R] Can I monitor the iterative/convergence process while using Optim or MaxLik?

2010-09-14 Thread Sally Luo
Hi R-helpers, Is it possible that I have the estimates from each step/iteration shown on the computer screen in order to monitor the process while I am using Optim or MaxLik? Thanks for your help. Maomao [[alternative HTML version deleted]]

[R] How can I fixe convergence=1 in optim

2010-09-04 Thread Sally Luo
Hi R users, I am using the optim funciton to maximize a log likelihood function. My code is as follows: p-optim(c(-0.2392925,0.4653128,-0.8332286, 0.0657, -0.0031, -0.00245, 3.366, 0.5885, -0.8, 0.0786,-0.00292,-0.00081, 3.266, -0.3632, -0.49,0.1856, 0.00394,

[R] What does this warning message (from optim function) mean?

2010-08-25 Thread Sally Luo
Hi R users, I am trying to use the optim function to maximize a likelihood funciton, and I got the following warning messages. Could anyone explain to me what messege 31 means exactly? Is it a cause for concern? Since the value of convergence turns out to be zero, it means that the converging is