4-Oct-07GzLM PresentationBIOL 79321 The GzLM and SAS Or why it’s a necessary evil to learn code! Keith Lewis Department of Biology Memorial University,

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

Challenges in Estimating Demand Plasticity Dawit Mulugeta Merchandising AutoZone Manager, Merchandising Analysis.
Generalized Additive Models Keith D. Holler September 19, 2005 Keith D. Holler September 19, 2005.
Analysis of Categorical Data Nick Jackson University of Southern California Department of Psychology 10/11/
Data: Crab mating patterns Data: Typists (Poisson with random effects) (Poisson Regression, ZIP model, Negative Binomial) Data: Challenger (Binomial with.
A Model to Evaluate Recreational Management Measures Objective I – Stock Assessment Analysis Create a model to distribute estimated landings (A + B1 fish)
Logistic Regression I Outline Introduction to maximum likelihood estimation (MLE) Introduction to Generalized Linear Models The simplest logistic regression.
Experimental design and analyses of experimental data Lesson 2 Fitting a model to data and estimating its parameters.
Logistic Regression Example: Horseshoe Crab Data
Multiple Linear Regression
Loglinear Models for Independence and Interaction in Three-way Tables Veronica Estrada Robert Lagier.
PROC GLIMMIX: AN OVERVIEW
Overview of Logistics Regression and its SAS implementation
The Power of Proc Nlmixed. Introduction Proc Nlmixed fits nonlinear mixed-effects models (NLMMs) – models in which the fixed and random effects have a.
Generalized Linear Mixed Model English Premier League Soccer – 2003/2004 Season.
Part V The Generalized Linear Model Chapter 16 Introduction.
Datamining and statistical learning - lecture 9 Generalized linear models (GAMs)  Some examples of linear models  Proc GAM in SAS  Model selection in.
Some Terms Y =  o +  1 X Regression of Y on X Regress Y on X X called independent variable or predictor variable or covariate or factor Which factors.
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.
Linear statistical models 2008 Binary and binomial responses The response probabilities are modelled as functions of the predictors Link functions: the.
Be humble in our attribute, be loving and varying in our attitude, that is the way to live in heaven.
EPI 809/Spring Multiple Logistic Regression.
1 Modeling Ordinal Associations Section 9.4 Roanna Gee.
Logistic Regression Biostatistics 510 March 15, 2007 Vanessa Perez.
Linear statistical models 2008 Count data, contingency tables and log-linear models Expected frequency: Log-linear models are linear models of the log.
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.
Poisson Regression Caution Flags (Crashes) in NASCAR Winston Cup Races L. Winner (2006). “NASCAR Winston Cup Race Results for ,” Journal.
Logistic Regression II Simple 2x2 Table (courtesy Hosmer and Lemeshow) Exposure=1Exposure=0 Disease = 1 Disease = 0.
SAS Lecture 5 – Some regression procedures Aidan McDermott, April 25, 2005.
Statistical Discovery. TM From SAS. JMP ® Software: Introduction to Categorical Data Analysis.
Categorical Data Analysis School of Nursing “Categorical Data Analysis 2x2 Chi-Square Tests and Beyond (Multiple Categorical Variable Models)” Melinda.
Fixed vs. Random Effects Fixed effect –we are interested in the effects of the treatments (or blocks) per se –if the experiment were repeated, the levels.
1 Experimental Statistics - week 4 Chapter 8: 1-factor ANOVA models Using SAS.
APPLICATION OF MULTIVARIATE ANALYSES TO FIND PREDICTORS OF MULTIPLE GESTATIONS FOLLOWING IN VITRO FERTILIZATION Krisztina Boda and Péter Kovács Department.
ALISON BOWLING THE GENERAL LINEAR MODEL. ALTERNATIVE EXPRESSION OF THE MODEL.
Antonio Curtis Wai Mak Alvin Hsieh Statistics Students, CSUH Stat 6601 Project: Model Formulae (V&R 6.2)
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.
Xuhua Xia Polynomial Regression A biologist is interested in the relationship between feeding time and body weight in the males of a mammalian species.
2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC.
1 The greatest achievement in life is to be able to get up again from failure.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Introduction to Multiple Imputation CFDR Workshop Series Spring 2008.
GEE Approach Presented by Jianghu Dong Instructor: Professor Keumhee Chough (K.C.) Carrière.
STAT 3130 Statistical Methods I Lecture 1 Introduction.
BUSI 6480 Lecture 8 Repeated Measures.
Topic 26: Analysis of Covariance. Outline One-way analysis of covariance –Data –Model –Inference –Diagnostics and rememdies Multifactor analysis of covariance.
Xuhua Xia Correlation and Regression Introduction to linear correlation and regression Numerical illustrations SAS and linear correlation/regression –CORR.
1 STA 517 – Chp4 Introduction to Generalized Linear Models 4.3 GENERALIZED LINEAR MODELS FOR COUNTS  count data - assume a Poisson distribution  counts.
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 Topic 4 : Ordered Logit Analysis. 2 Often we deal with data where the responses are ordered – e.g. : (i) Eyesight tests – bad; average; good (ii) Voting.
Crossover Design and Proc Mixed In SAS
Sigmoidal Response (knnl558.sas). Programming Example: knnl565.sas Y = completion of a programming task (1 = yes, 0 = no) X 2 = amount of programming.
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.
Logistic Regression Saed Sayad 1www.ismartsoft.com.
1 Say good things, think good thoughts, and do good deeds.
Dependent Variable Discrete  2 values – binomial  3 or more discrete values – multinomial  Skewed – e.g. Poisson Continuous  Non-normal.
Topic 27: Strategies of Analysis. Outline Strategy for analysis of two-way studies –Interaction is not significant –Interaction is significant What if.
Applied Epidemiologic Analysis - P8400 Fall 2002 Labs 6 & 7 Case-Control Analysis ----Logistic Regression Henian Chen, M.D., Ph.D.
Testing Significance of coefficients Usually, first examination of model Does the model including the independent variable provide significantly more information.
Analysis of matched data Analysis of matched data.
Generalized Linear Models
Generalized Linear Model
ביצוע רגרסיה לוגיסטית. פרק ה-2
Presentation transcript:

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, St. John’s, Canada

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL Variables, Links, and Models ( Introduction to Categorical Data Analysis, A. Gresti 1996)

4-Oct-07GzLM PresentationBIOL 79329

4-Oct-07GzLM PresentationBIOL

4-Oct-07GzLM PresentationBIOL

4-Oct-07GzLM PresentationBIOL SAS Proc’s: the basics Data [dataset]; Infile [filename]; input [variables]; proc [glm (or genmod)]; model [model]; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GLM – Lin. Reg. Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake treat type pred n; proc glm; model pred = lake treat type; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GLM - ANOVA Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake treat type pred n; proc glm; class lake treat type; model pred = lake treat type; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GLM - ANOVA Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake $ treat $ type $ pred n; proc glm; class lake treat type; model pred = lake treat type; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GLM - ANCOVA Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake treat type pred n; proc glm; class treat type; model pred = lake treat type; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GENMOD – Log-Linear Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake treat type pred n; proc genmod; class lake treat type; model pred = lake treat type / dist=poisson link=log type1 type3; run;

4-Oct-07GzLM PresentationBIOL SAS PROC GENMOD – Logistic Regression Data nest97; infile ‘e:\testdata\97exp1.prn’; input lake treat type pred n; proc genmod; class lake treat type; model pred/n = lake treat type / dist=binomial link=logit type1 type3; run;

4-Oct-07GzLM PresentationBIOL A full example data an_01; infile 'C:\Documents and Settings\Micro-Tech Customer\My Documents\MyWork\thesis\ SAS\ch4\An_2000a.csv' firstobs=2 delimiter = ','; input park $ site $ grid $ nest $ dp vt; proc genmod; class park site grid nest; model dp = park|grid|nest / dist=bin link=logit type1 type3; /*make obstats out=keith noprint;*/ title 'Schmidts model, 2000 with contrasts'; lsmeans park grid nest; contrast 'bird v control' nest ; contrast 'contrl v large' nest ; estimate 'contrl v large' nest ; estimate 'bird v control' nest 1 1 0; estimate 'bF v bS' park 1 -1; estimate 'con v food' grid 1 -1; run;

4-Oct-07GzLM PresentationBIOL Deviance and G-tests GzLMs based on Maximum Likelihood Estimates (MLE) D= -2ln [likelihood of (current model) / (saturated model)] G=D(for model w/ variable)-D(model w/o variable) G is analagous to F-tests for GLM

4-Oct-07GzLM PresentationBIOL GENMOD output LR Statistics For Type 1 Analysis Chi- Source Deviance DF Square Pr > ChiSq Intercept park grid park*grid nest park*nest grid*nest park*grid*nest = 1.70, Chisquare = 1.70, df = 1 p =

4-Oct-07GzLM PresentationBIOL GENMOD output LR Statistics For Type 3 Analysis Chi- Source DF Square Pr > ChiSq park grid park*grid nest park*nest grid*nest park*grid*nest

4-Oct-07GzLM PresentationBIOL Why we use GzLM Same Data, Same Distribution From Sokal and Rohlf 1995, Box 11.2

4-Oct-07GzLM PresentationBIOL Why we use GzLM Same Data, Same Distribution From Sokal and Rohlf 1995, Box 11.2

4-Oct-07GzLM PresentationBIOL Why we use GzLM Same Data, Different Distribution (K.Lewis, M.Sc data)

4-Oct-07GzLM PresentationBIOL Why we use GzLM Same Data, Different Distribution (K.Lewis, M.Sc data) See Lewis 2005, Oikos

4-Oct-07GzLM PresentationBIOL SAS v. R SAS –Powerful –Widely used –Learning curve –Expensive R –Powerful –“limited” use –Learning curve –Free Resources –Peter Earle –The web!!!!

4-Oct-07GzLM PresentationBIOL References Criteria: –Readability –Examples with the software code! A. Agresti Introduction to Categorical Data Analysis. Wiley & Sons, New York. Littel et al SAS for Linear Models 4 th ed. Cary, NC: SAS Institute Inc.