An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-mixed-models/attachments/20140321/5969663b/attachment.pl>
Predicted values in MCMCglmm family="threshold"
3 messages · Shamil Sadigov, Jarrod Hadfield
Hi, have cp<-c(-Inf, 0, cp.est, Inf) where cp.est are the estimated cutpoints (if there are any - with 2 categories there are none). Have linear predictor nu = xb or nu=xb+zu. If the former (and there are random effects) then have v the sum of the variance components associated with that term, and if the latter have v as the units variance associated with that term. Have obs<-1:k where k is the number of categories (2+the number of estimated cutpoints) and the probability of falling into a category conditional on nu and v is: pnorm(cp[obs+1], nu , sqrt(v)) ? pnorm(cp[obs], nu, sqrt(v)) for family=threshold, and pnorm(cp[obs+1], nu , sqrt(v+1)) ? pnorm(cp[obs], nu, sqrt(v+1)) for ordinal. For example, cp.est<-1 cp<-c(-Inf, 0, cp.est, Inf) k<-2+length(cp.est) obs<-1:k nu<--1 v<-2 pnorm(cp[obs+1], nu , sqrt(v))-pnorm(cp[obs], nu, sqrt(v)) Jarrod Quoting Shamil Sadigov <shamil at gmail.com> on Fri, 21 Mar 2014 14:56:25 +0200:
Hi Jarrod,
I am using the new family="threshold" in MCMCglmm version 2.18 with a
5-variate ordered response. I would like to obtain the predicted responses
for on the original ordinal scale, but I am not sure how to do so for
either "ordinal" or the "threshold" family.
1. For family="threshold" the posterior predicted probabilities are :
post.pred[, keep] <- pnorm(post.pred[, keep], 0,
sqrt(postvar[, keep]))
How can I classify these probabilities into the original ordinal scale?
2. I can see that for family="ordinal", cut points (CP) are used in
predict.MCMCglmm():
for (i in 2:(dim(CP)[2] - 1)) {
q <- q + (pnorm(CP[, i + 1] - post.pred[, keep], 0,
sqrt(postvar[, keep] + 1)) - pnorm(CP[, i] - post.pred[, keep], 0,
sqrt(postvar[, keep] + 1))) * (i - 1)
}
Are the thresholds and the posterior predictive values (using type =
"terms") on the linear (latent variable) scale?
What would be the interpretation of the predicted values obtained from
using type= "response" with family = "ordinal"? (All 5 ordinal responses
are coded 1-3, and the predicted values from predict.MCMCglmm are real
numbers between 0-6.)
Regards,
Shamil.
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Hi, ? should be - (and microsoft should be *) Jarrod Quoting Jarrod Hadfield <j.hadfield at ed.ac.uk> on Fri, 21 Mar 2014 14:14:50 +0000:
Hi, have cp<-c(-Inf, 0, cp.est, Inf) where cp.est are the estimated cutpoints (if there are any - with 2 categories there are none). Have linear predictor nu = xb or nu=xb+zu. If the former (and there are random effects) then have v the sum of the variance components associated with that term, and if the latter have v as the units variance associated with that term. Have obs<-1:k where k is the number of categories (2+the number of estimated cutpoints) and the probability of falling into a category conditional on nu and v is: pnorm(cp[obs+1], nu , sqrt(v)) ? pnorm(cp[obs], nu, sqrt(v)) for family=threshold, and pnorm(cp[obs+1], nu , sqrt(v+1)) ? pnorm(cp[obs], nu, sqrt(v+1)) for ordinal. For example, cp.est<-1 cp<-c(-Inf, 0, cp.est, Inf) k<-2+length(cp.est) obs<-1:k nu<--1 v<-2 pnorm(cp[obs+1], nu , sqrt(v))-pnorm(cp[obs], nu, sqrt(v)) Jarrod Quoting Shamil Sadigov <shamil at gmail.com> on Fri, 21 Mar 2014 14:56:25 +0200:
Hi Jarrod,
I am using the new family="threshold" in MCMCglmm version 2.18 with a
5-variate ordered response. I would like to obtain the predicted responses
for on the original ordinal scale, but I am not sure how to do so for
either "ordinal" or the "threshold" family.
1. For family="threshold" the posterior predicted probabilities are :
post.pred[, keep] <- pnorm(post.pred[, keep], 0,
sqrt(postvar[, keep]))
How can I classify these probabilities into the original ordinal scale?
2. I can see that for family="ordinal", cut points (CP) are used in
predict.MCMCglmm():
for (i in 2:(dim(CP)[2] - 1)) {
q <- q + (pnorm(CP[, i + 1] - post.pred[, keep], 0,
sqrt(postvar[, keep] + 1)) - pnorm(CP[, i] - post.pred[, keep], 0,
sqrt(postvar[, keep] + 1))) * (i - 1)
}
Are the thresholds and the posterior predictive values (using type =
"terms") on the linear (latent variable) scale?
What would be the interpretation of the predicted values obtained from
using type= "response" with family = "ordinal"? (All 5 ordinal responses
are coded 1-3, and the predicted values from predict.MCMCglmm are real
numbers between 0-6.)
Regards,
Shamil.
[[alternative HTML version deleted]]
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.