Displaying 2 results from an estimated 2 matches for "mydta".
Did you mean:
mydata
2012 Aug 01
1
optim() for ordered logit model with parallel regression assumption
...tment of Sociology
Ball State University
Muncie, IN 47306
####################################################################
library(foreign)
readin <- read.dta("ordfile.dta", convert.factors=FALSE)
myvars <- c("depvar", "x1", "x2", "x3")
mydta <- readin[myvars]
# remove all missings
mydta <- na.omit(mydta)
# theta is the parameter vector
ologit.lf <- function(theta, y, X) {
n <- nrow(X)
k <- ncol(X)
# b is the coefficient vector for independent variables
b <- theta[1:k]
# tau1 is cut-point 1
tau1 <- theta [k...
2011 May 13
0
effects package for adjusted predictions
...problems
figuring out how to produce an adjusted mean.? For example, using the
following two lines, I can get predictions when phd varies from 1 to
5, female set to 0 and enrol set to its mean, and then use the plot to
get predicted probability plot.
logitmod <- glm(hijob~female+enrol+phd, data=mydta,
family=binomial(lin="logit"))
plot(effect("phd", logitmod, xlevels=list(phd=1:5), given.values=c(female=0)))
But I couldn't figure out how to get just one predicted probability
with a given set of values for independent variables (for example,
female=1, phd=3 and enrol =...