I'm using functions ideal and rollcall from pscl package but the same voters receive alternatively negative sign values or positive sign values depending (at list) on the ordering of the dataset. As I'm calculating this for several periods, I need its behavior to be consistent for every year.
Is there any way to control this aspect?
How to obtain consistently sign direction using rollcall and ideal from pscl package?
58 views Asked by panchtox At
1
Okey, so looking at the documentation it looks like you can use the
priorsargument to specify which legislator you want to be your negative anchor and which one to be the positive anchor. See https://cran.r-project.org/web/packages/pscl/pscl.pdfSay for instance you know that legislator 1 is the most conservative and legislator 50 is the least conservative, you could make a matrix of means to use as priors. Based on the documentation anything you don't specify will use the default priors.
Now when you go into the
idealfunction you can specifyxpin the priors argument as below:Without some data, I can't test it, but that should work. Additionally, instead of just fixing two persons you could have an ifelse statement and assign priors to a party:
Or something like this. I have an example of the above here, but it uses
rstan.