Package SimCorMultRes

Similar documents
Package GenOrd. September 12, 2015

R Package multgee: A Generalized Estimating Equations Solver for Multinomial Responses

Appendix. A.1 Independent Random Effects (Baseline)

Package ensemblemos. March 22, 2018

mfx: Marginal Effects, Odds Ratios and Incidence Rate Ratios for GLMs

Package LNIRT. R topics documented: November 14, 2018

Package gmediation. R topics documented: June 27, Type Package

Package mle.tools. February 21, 2017

Probits. Catalina Stefanescu, Vance W. Berger Scott Hershberger. Abstract

Package FADA. May 20, 2016

Package optimstrat. September 10, 2018

The Lmoments Package

Package QRank. January 12, 2017

STATISTICAL METHODS FOR CATEGORICAL DATA ANALYSIS

Package EMT. February 19, 2015

Package smam. October 1, 2016

Package scenario. February 17, 2016

Package MSMwRA. August 7, 2018

Package dng. November 22, 2017

Package XNomial. December 24, 2015

Package SMFI5. February 19, 2015

Analysis of Microdata

Package PairTrading. February 15, 2013

Dan Breznitz Munk School of Global Affairs, University of Toronto, 1 Devonshire Place, Toronto, Ontario M5S 3K7 CANADA

Package semsfa. April 21, 2018

Introductory Econometrics for Finance

Package MultiSkew. June 24, 2017

CHAPTER 12 EXAMPLES: MONTE CARLO SIMULATION STUDIES

2. Copula Methods Background

A Comparison of Univariate Probit and Logit. Models Using Simulation

STA 4504/5503 Sample questions for exam True-False questions.

Package MixedPoisson

Bayesian Multinomial Model for Ordinal Data

Package GCPM. December 30, 2016

A First Course in Probability

ANALYSIS OF DISCRETE DATA STATA CODES. Standard errors/robust: vce(vcetype): vcetype may be, for example, robust, cluster clustvar or bootstrap.

Package UnifQuantReg

A MULTIVARIATE ANALYSIS OF FINANCIAL AND MARKET- BASED VARIABLES FOR BOND RATING PREDICTION

Using Halton Sequences. in Random Parameters Logit Models

Hierarchical Generalized Linear Models. Measurement Incorporated Hierarchical Linear Models Workshop

Package cbinom. June 10, 2018

Forecasting Design Day Demand Using Extremal Quantile Regression

Package ratesci. April 21, 2017

15. Multinomial Outcomes A. Colin Cameron Pravin K. Trivedi Copyright 2006

Package uqr. April 18, 2017

Package ELMSO. September 3, 2018

Package stable. February 6, 2017

Package PortRisk. R topics documented: November 1, Type Package Title Portfolio Risk Analysis Version Date

Package multiassetoptions

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2011, Mr. Ruey S. Tsay. Solutions to Final Exam.

9. Logit and Probit Models For Dichotomous Data

Package finiteruinprob

Financial Risk Management

CHAPTER 8 EXAMPLES: MIXTURE MODELING WITH LONGITUDINAL DATA

Multinomial Logit Models for Variable Response Categories Ordered

Package PortfolioOptim

Package quantileda. R topics documented: February 2, 2016

International Finance. Estimation Error. Campbell R. Harvey Duke University, NBER and Investment Strategy Advisor, Man Group, plc.

Package eesim. June 3, 2017

ARCH Models and Financial Applications

A Joint Credit Scoring Model for Peer-to-Peer Lending and Credit Bureau

book 2014/5/6 15:21 page 261 #285

Introduction to POL 217

Halton Sequences for Mixed Logit. By Kenneth Train 1 Department of Economics University of California, Berkeley. July 22, 1999 Revised August 2, 1999

Package cnbdistr. R topics documented: July 17, 2017

Context Power analyses for logistic regression models fit to clustered data

Crafting Mass Partisanship at the Grass Roots

XLSTAT TIP SHEET FOR BUSINESS STATISTICS CENGAGE LEARNING

*9-BES2_Logistic Regression - Social Economics & Public Policies Marcelo Neri

COMMUNITY ADVANTAGE PANEL SURVEY: DATA COLLECTION UPDATE AND ANALYSIS OF PANEL ATTRITION

Missing Data. EM Algorithm and Multiple Imputation. Aaron Molstad, Dootika Vats, Li Zhong. University of Minnesota School of Statistics

Package rtip. R topics documented: April 12, Type Package

Econometrics II Multinomial Choice Models

High-Frequency Data Analysis and Market Microstructure [Tsay (2005), chapter 5]

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

Case Study: Applying Generalized Linear Models

What s New in Econometrics. Lecture 11

List of tables List of boxes List of screenshots Preface to the third edition Acknowledgements

Package YieldCurve. July 2, 2014

THE EQUIVALENCE OF THREE LATENT CLASS MODELS AND ML ESTIMATORS

International Journal of Computer Engineering and Applications, Volume XII, Issue II, Feb. 18, ISSN

CREDIT RISK MODELING IN R. Logistic regression: introduction

Hidden Markov Models & Applications Using R

Principles of Finance

Credit Scoring Modeling

Discrete Choice Modeling

Phd Program in Transportation. Transport Demand Modeling. Session 11

To be two or not be two, that is a LOGISTIC question

A MODIFIED MULTINOMIAL LOGIT MODEL OF ROUTE CHOICE FOR DRIVERS USING THE TRANSPORTATION INFORMATION SYSTEM

Package tailloss. August 29, 2016

Package easi. February 15, 2013

State Dependence in a Multinominal-State Labor Force Participation of Married Women in Japan 1

Package cumstats. R topics documented: January 16, 2017

The University of Chicago, Booth School of Business Business 41202, Spring Quarter 2012, Mr. Ruey S. Tsay. Solutions to Final Exam

Probability Distributions: Discrete

Modeling. joint work with Jed Frees, U of Wisconsin - Madison. Travelers PASG (Predictive Analytics Study Group) Seminar Tuesday, 12 April 2016

Economics Multinomial Choice Models

Assessment on Credit Risk of Real Estate Based on Logistic Regression Model

INTERNATIONAL REAL ESTATE REVIEW 2002 Vol. 5 No. 1: pp Housing Demand with Random Group Effects

Chapter 2 Uncertainty Analysis and Sampling Techniques

Transcription:

Package SimCorMultRes February 15, 2013 Type Package Title Simulates Correlated Multinomial Responses Version 1.0 Date 2012-11-12 Author Anestis Touloumis Maintainer Anestis Touloumis <anestis@ebi.ac.uk> Depends R(>= 2.15.0), mvtnorm, evd Suggests multgee Description This package simulates correlated multinomial responses utilizing threshold approaches and assuming a cumulative link model or a baseline category logit model for the univariate marginal probabilities. License GPL-3 LazyLoad yes Repository CRAN Date/Publication 2012-11-12 18:37:14 NeedsCompilation no R topics documented: SimCorMultRes-package.................................. 2 rmult.bcl........................................... 2 rmult.clm.......................................... 4 rnorta............................................ 6 Index 8 1

2 rmult.bcl SimCorMultRes-package Simulating Correlated Multinomial Responses Description Functions to simulate correlated nominal or ordinal multinomial responses assuming a cumulative link model or a baseline category logit model for the univariate marginal probabilities. Details The simulated correlated multinomial responses are drawn as realizations of an underlying regression model for continuous random vectors. The correlation structure is expressed in terms of the latent random vectors. For ordinal response categories, the multinomial responses are produced by chopping off the corresponding latent variables (McCullagh, 1980), and for nominal response categories by utilizing the principle of maximum random utility (McFadden, 1973). The functions are suitable to generate correlated ordinal or nominal multinomial responses when a cumulative link model or a baseline category logit model, respectively, holds for the univariate marginal probabilities. The package can ease the simulation of correlated multinomial responses when the interest lies on estimating the marginal regression coefficient parameters, e.g. using a GEE model. An example is given in Touloumis, Agresti and Kateri (2012). Author(s) Anestis Touloumis <anestis@ebi.ac.uk> Maintainer: Anestis Touloumis <anestis@ebi.ac.uk> References McCullagh, P. (1980). Regression models for ordinal data. Journal of the Royal Statistical Society B, pp 109-142. McFadden, D. (1973). Conditional logit analysis of qualitative choice behavior. Institute of Urban and Regional Development, University of California. Touloumis, A., Agresti, A. and Kateri, M. (2012). GEE for multinomial responses using a local odds ratios parameterization. Submitted. rmult.bcl Simulating Correlated Nominal Multinomial Responses Description This function generates correlated nominal multinomial responses assuming a baseline category logit model for the univariate marginal probabilities.

rmult.bcl 3 Usage rmult.bcl(clsize, ncategories, lin.pred, cor.matrix) Arguments clsize ncategories lin.pred cor.matrix integer indicating the common cluster size. integer indicating the number of response categories. matrix with clsize x ncategories columns. See details for more info. matrix indicating the correlation matrix of the multivariate normal distribution in the NORTA method. Details 1. Each multinomial response is obtained by utilizing the principle of maximum random utility. 2. The row dimension of lin.pred equals the sample size. Rows correspond to subjects. Columns t (ncategories)+1,..., 2 ncategories correspond to the 1,..., ncategories-th category specific linear predictor at occasion t respectively. 3. The algorithm forces cor.matrix to respect the local independence assumption between the alternatives. Value Ysim correlation rlatent the correlated nominal multinomial responses. the correlation matrix of the multivariate normal distribution in the NORTA method. the latent random vectors after applying the NORTA method. Author(s) Anestis Touloumis References Li, S.T. and Hammond, J.L. (1975). Generation of pseudorandom numbers with specified univariate distributions and correlation coefficients. IEEE Transacions on Systems, Man and Cybernetics (5), pp 557-561. McFadden, D. (1973). Conditional logit analysis of qualitative choice behavior. Institute of Urban and Regional Development, University of California. See Also rnorta, rmult.clm

4 rmult.clm Examples ## Simulating 500 correlated nominal multinomial responses assuming a baseline category ## logit model for the univariate marginal probabilities. ## In particular we assume that all the category-specific intercepts are equal to 1 ## and all the category-specific coefficients are equal to 2. ## Further we sample a cluster specific covariate from a standard normal distribution. set.seed(1) N <- 500 ncategories <- 4 clustersize <- 3 Xmat <- matrix(rnorm(n),n,ncategories) betas <- c(1,2,1,2,1,2) linpred <- matrix(c(betas[c(2,4,6)],0),n,4,byrow=true)*xmat+ matrix(c(betas[c(1,3,5)],0),n,4,byrow=true) linpred <- matrix(linpred,n,ncategories*clustersize) cormat <- toeplitz(c(1,rep(0,3),rep(c(0.9,0,0,0),2))) ## We fit a GEE model to illustrate that the regression coefficients can be estimated library(multgee) Y <- rmult.bcl(clsize=3,ncategories=4,lin.pred=linpred,cor.matrix=cormat)$ysim data <- cbind(c(t(y)),c(t(xmat[,-ncategories]))) data <- data.frame(data) data$id <- rep(1:n,each=clustersize) data$time <- rep(1:clustersize,n) colnames(data) <- c("y","x","id","time") fitmod <- nomlorgee(y~x,id="id",repeated="time",data=data,add=0.01) ## The GEE estimates of the regression coefficients coef(fitmod) rmult.clm Simulating Correlated Ordinal Multinomial Responses Description Usage This function generates correlated ordinal multinomial responses assuming a cumulative link model for the univariate marginal probabilities. rmult.clm(clsize, lin.pred, corr, cuts, link = "probit") Arguments clsize lin.pred integer indicating the common cluster size. matrix with clsize columns. See details for more info.

rmult.clm 5 corr cuts link matrix or constant describing the latent correlation structure. See details for more info. vector containing the intercepts of the cumulative link model, and -Inf and Inf as first and last elements respectively. character string indicating the link function of the cumulative link model. Options include "probit", "logit", "clogclog" or "cauchit". Details 1. Each multinomial response takes the value j if and only if the corresponding latent random variable is on (cuts j 1, cuts j ]. 2. The row dimension of lin.pred equals the sample size. 3. lin.pred contains the linear predictor of the cumulative link model after subtracting the intercepts. 4. If corr is a matrix, then the NORTA method is employed and the correlation matrix corresponds to that of the multivariate normal distribution. Otherwise, it must be a constant on [0,1). For the cloglog link, it generates latent random vectors from a multivariate Gumbel distribution with correlation parameter corr. For the logit link, it generates the latent random vectors as the difference of two indepedent random vectors that follow a multivariate Gumbel distribution with correlation parameter corr. Value Ysim correlation rlatent the correlated ordinal multinomial responses. the latent correlation matrix. the underlying latent random vectors. Author(s) Anestis Touloumis References Li, S.T. and Hammond, J.L. (1975). Generation of pseudorandom numbers with specified univariate distributions and correlation coefficients. IEEE Transacions on Systems, Man and Cybernetics (5), pp 557-561. Balakrishnan, N. (1992). Handbook of the logistic distribution. Gumbel, E.J. (1961). Multivariate extremal distributions. Bulletin de l Institut International de Statistiques. Touloumis, A., Agresti, A. and Kateri, M. (2012). GEE for multinomial responses using a local odds ratios parameterization. Submitted. See Also rnorta, rmult.bcl

6 rnorta Examples ## Simulating 500 correlated ordinal multinomial responses assuming a probit cumulative ## link model for the univariate marginal probabilities. The model is described in Touloumis, ## Agresti and Kateri (2012) with a toeplitz underlying correlation structure and a ## time-varying covariates design. set.seed(12345) N <- 500 clustersize <- 4 intercepts <- c(-inf,-1.5,-0.5,0.5,1.5,inf) cormat <- toeplitz(c(1,0.85,0.5,0.15)) linpred <- rmvnorm(n,sigma=toeplitz(c(1,rep(0.85,clustersize-1)))) Y <- rmult.clm(clsize=clustersize,lin.pred=linpred,corr=cormat, cuts=intercepts,link="probit")$ysim data <- cbind(c(t(y)),c(t(linpred))) data <- data.frame(data) data$id <- rep(1:n,each=clustersize) data$time <- rep(1:clustersize,n) colnames(data) <- c("y","x","id","time") ## We fit a GEE model to illustrate that the regression coefficients can be estimated library(multgee) fitmod <- ordlorgee(y~x,data=data,id="id",repeated="time",link="probit",im="cholesky") ## The GEE estimates of the regression coefficients coef(fitmod) rnorta Simulating Continuous Random Vectors Using The NORTA Method Description Usage This function generates continuous random vectors with prescribed univariate marginal distributions using the NORTA method. rnorta(r = R, cor.matrix = cor.matrix, distr = "normal") Arguments R cor.matrix distr integer indicating the sample size. matrix indicating the correlation matrix of the multivariate normal distribution in the NORTA method. character string indicating the desired univariate marginal distributions. Options include "normal", "logistic", "extreme" or "cauchy".

rnorta 7 Details Value Checks are made to ensure that cor.matrix is a valid semi-positive correlation matrix. The semipositiveness of cor.matrix is determined by the eigenvalues. Returns R random vectors of size equal to the row dimension of cor.matrix and univariate marginal distributions distr. Author(s) Anestis Touloumis References Li, S.T. and Hammond, J.L. (1975). Generation of pseudorandom numbers with specified univariate distributions and correlation coefficients. IEEE Transacions on Systems, Man and Cybernetics (5), pp 557-561. Examples ## An example with marginal standard logistic distributions. set.seed(1) logit.sim <- rnorta(r = 1000, cor.matrix = toeplitz(c(1,rep(0.8,3))), distr = "logistic") ## The following illustrates how the NORTA method works. set.seed(1) norm.sim <- rmvnorm(1000, sigma = toeplitz(c(1,rep(0.8,3)))) all(logit.sim==qlogis(pnorm(norm.sim)))

Index Topic package SimCorMultRes-package, 2 rmult.bcl, 2, 5 rmult.clm, 3, 4 rnorta, 3, 5, 6 SimCorMultRes (SimCorMultRes-package), 2 SimCorMultRes-package, 2 8