The Power of Proc Nlmixed. Introduction Proc Nlmixed fits nonlinear mixed-effects models (NLMMs) – models in which the fixed and random effects have a.

Slides:



Advertisements
Similar presentations
A. The Basic Principle We consider the multivariate extension of multiple linear regression – modeling the relationship between m responses Y 1,…,Y m and.
Advertisements

The %LRpowerCorr10 SAS Macro Power Estimation for Logistic Regression Models with Several Predictors of Interest in the Presence of Covariates D. Keith.
Data: Crab mating patterns Data: Typists (Poisson with random effects) (Poisson Regression, ZIP model, Negative Binomial) Data: Challenger (Binomial with.
I OWA S TATE U NIVERSITY Department of Animal Science PROC GLIMMIX Generalized Mixed Linear Models Animal Science 500 Lecture No October 25, 2010.
TRIM Workshop Arco van Strien Wildlife statistics Statistics Netherlands (CBS)
PROC GLIMMIX: AN OVERVIEW
Overview of Logistics Regression and its SAS implementation
Chapter 4: Linear Models for Classification
Generalized Linear Mixed Model English Premier League Soccer – 2003/2004 Season.
6.1.4 AIC, Model Selection, and the Correct Model oAny model is a simplification of reality oIf a model has relatively little bias, it tends to provide.
© Willett, Harvard University Graduate School of Education, 5/21/2015S052/I.3(b) – Slide 1 More details can be found in the “Course Objectives and Content”
Datamining and statistical learning - lecture 9 Generalized linear models (GAMs)  Some examples of linear models  Proc GAM in SAS  Model selection in.
Log-Linear Models & Dependent Samples Feng Ye, Xiao Guo, Jing Wang.
1 Experimental design and analyses of experimental data Lesson 6 Logistic regression Generalized Linear Models (GENMOD)
Linear statistical models 2009 Models for continuous, binary and binomial responses  Simple linear models regarded as special cases of GLMs  Simple linear.
EPI 809/Spring Multiple Logistic Regression.
1 Modeling Ordinal Associations Section 9.4 Roanna Gee.
Logistic Regression Biostatistics 510 March 15, 2007 Vanessa Perez.
OLS versus MLE Example YX Here is the data:
WLS for Categorical Data
Linear statistical models 2009 Count data  Contingency tables and log-linear models  Poisson regression.
Longitudinal Data Analysis: Why and How to Do it With Multi-Level Modeling (MLM)? Oi-man Kwok Texas A & M University.
Maximum likelihood (ML)
1 Introduction to mixed models Ulf Olsson Unit of Applied Statistics and Mathematics.
Logistic Regression II Simple 2x2 Table (courtesy Hosmer and Lemeshow) Exposure=1Exposure=0 Disease = 1 Disease = 0.
GEE and Generalized Linear Mixed Models
SAS Lecture 5 – Some regression procedures Aidan McDermott, April 25, 2005.
Logistic Regression and Generalized Linear Models:
1 Experimental Statistics - week 7 Chapter 15: Factorial Models (15.5) Chapter 17: Random Effects Models.
© 2002 Prentice-Hall, Inc.Chap 14-1 Introduction to Multiple Regression Model.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
Slide no 1 Wan Hui Ong Clausen and Birgitte B. Rønn 26/ Dealing with censored data in linear and non-linear models Wan Hui Ong Clausen Birgitte Biilmann.
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation Note: Homework Due Thursday.
1 Experimental Statistics - week 2 Review: 2-sample t-tests paired t-tests Thursday: Meet in 15 Clements!! Bring Cody and Smith book.
Tailored Products Group Analysis Silver Chung Marshall Shen.
April 6 Logistic Regression –Estimating probability based on logistic model –Testing differences among multiple groups –Assumptions for model.
2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC.
Multilevel Linear Modeling aka HLM. The Design We have data at two different levels In this case, 7,185 students (Level 1) Nested within 160 Schools (Level.
4-Oct-07GzLM PresentationBIOL The GzLM and SAS Or why it’s a necessary evil to learn code! Keith Lewis Department of Biology Memorial University,
Linear correlation and linear regression + summary of tests
6-1 Introduction To Empirical Models Based on the scatter diagram, it is probably reasonable to assume that the mean of the random variable Y is.
GEE Approach Presented by Jianghu Dong Instructor: Professor Keumhee Chough (K.C.) Carrière.
BUSI 6480 Lecture 8 Repeated Measures.
Lecture 12: Cox Proportional Hazards Model
1 STA 617 – Chp11 Models for repeated data Analyzing Repeated Categorical Response Data  Repeated categorical responses may come from  repeated measurements.
1 Experimental Statistics - week 12 Chapter 12: Multiple Regression Chapter 13: Variable Selection Model Checking.
1 STA 617 – Chp10 Models for matched pairs Summary  Describing categorical random variable – chapter 1  Poisson for count data  Binomial for binary.
Log-linear Models HRP /03/04 Log-Linear Models for Multi-way Contingency Tables 1. GLM for Poisson-distributed data with log-link (see Agresti.
1 STA 617 – Chp12 Generalized Linear Mixed Models SAS for Model (12.3) with Matched Pairs from Table 12.1.
Sigmoidal Response (knnl558.sas). Programming Example: knnl565.sas Y = completion of a programming task (1 = yes, 0 = no) X 2 = amount of programming.
Topic 20: Single Factor Analysis of Variance. Outline Analysis of Variance –One set of treatments (i.e., single factor) Cell means model Factor effects.
SAS® Global Forum 2014 March Washington, DC Got Randomness?
Applied Epidemiologic Analysis - P8400 Fall 2002 Labs 6 & 7 Case-Control Analysis ----Logistic Regression Henian Chen, M.D., Ph.D.
1 STA 617 – Chp12 Generalized Linear Mixed Models Modeling Heterogeneity among Multicenter Clinical Trials  compare two groups on a response for.
Logistic Regression Saed Sayad 1www.ismartsoft.com.
ALISON BOWLING MAXIMUM LIKELIHOOD. GENERAL LINEAR MODEL.
1 Statistics 262: Intermediate Biostatistics Regression Models for longitudinal data: Mixed Models.
Multiple Imputation using SAS Don Miller 812 Oswald Tower
Dependent Variable Discrete  2 values – binomial  3 or more discrete values – multinomial  Skewed – e.g. Poisson Continuous  Non-normal.
Armando Teixeira-Pinto AcademyHealth, Orlando ‘07 Analysis of Non-commensurate Outcomes.
Biostatistics Case Studies Peter D. Christenson Biostatistician Session 3: Missing Data in Longitudinal Studies.
G Lecture 71 Revisiting Hierarchical Mixed Models A General Version of the Model Variance/Covariances of Two Kinds of Random Effects Parameter Estimation.
1 Experimental Statistics - week 11 Chapter 11: Linear Regression and Correlation.
Maximising the Value of Time Series Data:
Generalized Linear Models
Linear Mixed Models in JMP Pro
ביצוע רגרסיה לוגיסטית. פרק ה-2
Andrea Friese, Silvia Artuso, Danai Laina
Modeling Ordinal Associations Bin Hu
Presentation transcript:

The Power of Proc Nlmixed

Introduction Proc Nlmixed fits nonlinear mixed-effects models (NLMMs) – models in which the fixed and random effects have a nonlinear relationship NLMMs are widespread in pharmacokinetics – ? genesis of procedure Nlmixed was first available in Version 7 (experimental) and then in Version 8 (production)

Introduction (cont.) Nlmixed is similar to the Nlinmix and Glimmix macros but uses a different estimation method, and is much easier to use Macros iteratively fit a set of GEEs, whereas Nlmixed directly maximizes an approximation of the likelihood, integrated over the random effects

Example: logistic regression with residual error Say you design an experiment with a single treatment that has levels Each treatment level is randomly assigned to a bunch of plots, and each plot contains m = 30 trees Replication is balanced, so that the same number of plots occur within each treatment level Within each plot you measure y, the number of trees within the plot that are infected by some disease The objective is to see whether the treatment has an effect on the incidence of the disease

Example (cont.) Modeling this scenario… or

Example (cont.) Consequences of model: where Notice that the inflation factor is a function of, and not constant (i.e. it changes for each treatment level)

Example (cont.) How do we fit this model in SAS? Proc Catmod or Nlin – crude model without any overdispersion Proc Logistic or Genmod – simple overdispersed model Glimmix or Nlinmix macros – iterative GEE approach Proc Nlmixed – exact (sort of) approach

Proc Genmod code proc genmod data=fake; class treat; model y/m=treat / scale=p link=logit dist=binomial type3; title 'Random-effects Logistic Regression using Proc Genmod'; output out=results pred=pred; run;

Proc Genmod Output Criteria For Assessing Goodness Of Fit Criterion DF Value Value/DF Deviance Pearson Chi-Square Log Likelihood Analysis Of Parameter Estimates Standard Wald 95% Chi- Parameter DF Estimate Error Confidence Limits Square Pr > ChiSq Intercept treat <.0001 treat <.0001 treat Scale NOTE: The scale parameter was estimated by the square root of Pearson's Chi-Square/DOF. LR Statistics For Type 3 Analysis Source Num DF Den DF F Value Pr > F treat <.0001

Glimmix macro code %inc 'h:\SASPROGS\Glimmix macro\glmm800.sas' / nosource; %glimmix(data=fake, procopt=%str(method=reml covtest maxiter=100), maxit=100, out=results, stmts=%str( class treat ident; model y/m = treat / ddfm=residual; random ident; parms (0.25) (1) / hold=2; title 'Random-effects Logistic Regression using the Glimmix macro'; ), error=binomial, link=logit); run;

Glimmix macro output Covariance Parameter Estimates Standard Z Cov Parm Estimate Error Value Pr Z ident <.0001 Residual Fit Statistics -2 Res Log Likelihood Solution for Fixed Effects Standard Effect treat Estimate Error DF t Value Pr > |t| Intercept treat <.0001 treat <.0001 treat Type 3 Tests of Fixed Effects Effect Num DF Den DF F Value Pr > F treat <.0001

Proc Nlmixed code proc nlmixed data=fake tech=trureg df=297; bounds sigma2>0; parms mu=1 t1=-2 t2=2 sigma2=0.25; if treat=1 then eta=mu + t1 + e; else if treat=2 then eta=mu + t2 + e; else eta=mu + e; prob=exp(eta)/(1+exp(eta)); model y ~ binomial(m, prob); random e ~ normal(0, sigma2) subject=ident; contrast 'treat' t1, t2; predict prob out=results; title 'Random-effects Logistic Regression using Proc Nlmixed'; run;

Proc Nlmixed output Fit Statistics -2 Log Likelihood Parameter Estimates Standard Parameter Estimate Error DF t Value Pr > |t| mu t <.0001 t <.0001 sigma <.0001 Contrasts Num Den Label DF DF F Value Pr > F treat <.0001

Results treatment is significant estimates are similar Nlimixed works Parameter True value Parameter estimates NlinGenmodGlimmixNlmixedNlinmix n/a0.144* F ?

Core syntax Proc Nlmixed statement options tech= optimization algorithm several available (e.g. trust region) default is dual quasi-Newton method= controls method to approximate integration of likelihood over random effects default is adaptive Gauss-Hermite quadrature

Syntax (cont.) Model statement specify the conditional distribution of the data given the random effects e.g. Valid distributions: normal(m, v) binary(p) binomial(n, p) gamma(a,b) negbin(n, p) Poisson(m) general(log likelihood)

Syntax (cont.) Fan-shaped error model: proc nlmixed; parms a=0.3 b=0.5 sigma2=0.5; var = sigma2*x; pred = a + b*x; model y ~ normal(pred, var); run;

Syntax (cont.) Binomial: model y ~ binomial(m,prob); General: combin = gamma(m+1)/(gamma(y+1)*gamma(m-y+1)); loglike = y*log(prob)+(m-y)*log(1-prob)+ log(combin); model y ~ general(loglike);

Syntax (cont.) Random statement defines the random effects and their distribution e.g. The input data set must be clustered according to the SUBJECT= variable. Estimate and contrast statements also available

Summary Pros Syntax fairly straightforward Common distributions (conditional on the random effects) are built-in – via the model statement Likelihood can be user-specified if distribution is non- standard More exact than glimmix or nlinmix and runs faster than both of them

Summary (cont.) Cons Random effects must come from a (multivariate) normal distribution All random effects must share the same subject (i.e. cannot have multi-level mixed models) Random effects cannot be nested or crossed DF for Wald-tests or contrasts generally require manual intervention

A Smidgeon of Theory… Linear mixed-effects model and

Theory (cont.) Generalized linear mixed-effect model  The marginal distribution of y cannot usually be simplified due to nonlinear function

Theory (cont.) Nonlinear mixed-effect model Link h -1 (yielding linear combo) does not exist The marginal distribution of y is unavailable in closed form

Conclusion Flexibility of proc nlmixed makes it a good choice for many non-standard applications (e.g. non-linear models), even those without random effects.

References Huet, S., Bouvier, A., Poursat, M.-A., and E. Jolivet Statistical Tools for Nonlinear Regression. A Practical Guide with S-PLUS and R Examples, Second Edition. Springer-Verlag. New York. Littell, R.C., Milliken, G.A., Stroup, W.W., and R.D. Wolfinger SAS System for Mixed Models. Cary, NC. SAS Institute Inc. McCullogh, C.E. and S.R. Searle Generalized, Linear, and Mixed Models. John Wiley & Sons. New York Pinheiro, J.C. and D.M. Bates Mixed-effects Models in S and S-PLUS. Springer-Verlag. New York. SAS Institute Inc SAS OnlineDoc® Cary, NC: SAS Institute Inc.