Description Usage Arguments Details References Examples
RankTest
calcualtes the rank of the aggregate design matrix of a dataset
1 |
formula |
(required) a formula object of the form |
data |
(required) a data.frame object that contains all data used in the |
prpslid |
(required) the name for the consecutive numbered ([1, J]) integer variable that identifies each proposal uniquely in the data. |
gntid |
(required) the name for the consecutive numbered ([1, M]) integer variable that identifies each actor in the data. |
getAggData |
if |
This function is useful to evaluate a necessary condition for parameteric identification of the partial m-probit model.
Marbach, Moritz. 2016. 'Analyzing Decision Records from Committees.” Working Paper.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
require(plyr)
set.seed(10)
J <- 250 # proposal
I <- 10 # actors
R <- 6 # majority threshold
# Simualte roll call voting record
beta <- c(0,0.4)
X <- data.frame(x0=1,x1=runif(J*I,-2,2))
y <- rbinom(J*I, 1, pnorm(as.matrix(X) %*% beta))
# Bundle data with IDs
data <- data.frame(gntid=sort(rep(seq(1,I), J)),
prpslid=rep(seq(1,J), I),
y, X)
# Generate decision record
data <- ddply(data, "prpslid" ,function(x) {
x$y.agg <- as.numeric(sum(x$y) >= R)
return(x)
})
RankTest(formula=y.agg ~ x1, data=data, prpslid="prpslid", gntid="gntid")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.