CoryMcCartan / birdie

Bayesian Instrumental Regression for Disparity Estimation
http://corymccartan.com/birdie/
GNU General Public License v3.0
5 stars 3 forks source link

**bisg_me:** Error in dimnames(x) <- dn #18

Open lecy opened 4 days ago

lecy commented 4 days ago

Any ideas here?

m <- bisg_me( ~ nm(Lastname) + zip(ZIP.PPL), p_r="estimate", data=d )
Error in dimnames(x) <- dn : 
  length of 'dimnames' [2] not equal to array extent

d <-
structure(list(Lastname = c("COX", "KELLER", "NGUYEN", "JEANTY", 
"CURRENCE", "RAIMONDO", "PERKINS", "YOUNG", "BROWN", "ROBINSON", 
"NDISHABANDI", "REYDEL", "COINS", "DONALDSON", "DWYER", "SHAW", 
"CHISHOLM", "HEYTVELT", "CADY", "SMITH"), ZIP.PPL = c("93311", 
"95630", "50314", "33153", "44107", "19342", "98107", "44092", 
"48076", "32805", "07712", "33021", "39170", "32277", "60157", 
"36532", "20005", "99224", "99169", "16365")), row.names = c(NA, 
20L), class = "data.frame")
CoryMcCartan commented 3 days ago

Thanks for the bug report; sorry you ran into this. Will investigate further. I notice the code runs if you set p_r to the default or to a specific value. So for now I'm able to get around the bug by first estimating p_r using bisg() and then plugging that in:

p_r_est = attr(bisg(~ nm(Lastname) + zip(ZIP.PPL), data=d, p_r="estimate"), "p_r")
m <- bisg_me( ~ nm(Lastname) + zip(ZIP.PPL), p_r=p_r_est, data=d)