0

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?

panchtox
  • 634
  • 7
  • 16
  • 1
    The problem is that in general this kind of model suffers from identifibility hence the same solution. Looks like with the `` constrain.legis`` arg you could set your most conservative person for -3 and least conservative for +3 and that should solve your sign issue. – MDEWITT May 13 '19 at 20:48

1 Answers1

1

Okey, so looking at the documentation it looks like you can use the priors argument 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.pdf

Say 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.

# 50 legislators
my_mean <- rep(0, 50)

my_mean[1] <- -3
my_mean[50] <- 3

Now when you go into the ideal function you can specify xp in the priors argument as below:

ideal(object, codes = object$codes,
dropList = list(codes = "notInLegis", lop = 0),
d = 1, maxiter = 10000, thin = 100, burnin = 5000,
impute = FALSE,
normalize = FALSE,
meanzero = normalize,
priors = list(xp = my_mean),  # Here, all defaults used for other args
startvals = "eigen",
store.item = FALSE, file = NULL,
verbose=FALSE, use.voter=NULL)

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:

my_mean <- ifelse(party == "Conservative", -3, 3)

Or something like this. I have an example of the above here, but it uses rstan.

MDEWITT
  • 2,338
  • 2
  • 12
  • 23
  • During my first tries it didn't work. I'm using during rollcall a character vector with names as "legis.names" parameter value and for this test, used a numeric vector as prior with all zeros values except elements with range position equal to legis.names corresponding to legislators I've seen as most extreme. I've toggled their values from -3 to +3, but the results are pretty similar, without sign change. – panchtox May 14 '19 at 13:49