Download presentation
Presentation is loading. Please wait.
Published byClaribel Davis Modified over 8 years ago
1
1 STA 617 – Chp10 Models for matched pairs Summary Describing categorical random variable – chapter 1 Poisson for count data Binomial for binary data Multinomial for I>2 outcome categories Others Limitation: one parameter only, can be adjusted by scale parameter inference
2
2 STA 617 – Chp10 Models for matched pairs Summary Two-way contingency table – chapters 2, 3 Parameters: risk, odds Comparison: relative risk, odds ratio Estimation: delta method Tests: chi-square, fisher’s exact test Ordered two-way tables: assign scores - Trend test M 2 =(n-1)r 2 uses an ordinal measure of monotone trend: SAS: proc freq with option relarisk, chisq, exact, etc.
3
3 STA 617 – Chp10 Models for matched pairs Summary Three-way (multi-way) tables – chapter 2, 3 Partial tables Conditional and marginal odds ratio Conditional and marginal independence Inference – chapter 4-9: Third or others variables are considered as covariates modeling
4
4 STA 617 – Chp10 Models for matched pairs Summary – generalized linear models Random component is exponential family (not necessary normal) Systematic component – linear model Link function – connect mean to Systematic component xbeta Log Logit Identity
5
5 STA 617 – Chp10 Models for matched pairs Logistic regression Chapters 5-7 SAS proc logistic, genmod Binary outcome – logistic regression Multinomial response Nominal-baseline-category logit models Ordinal – cumulative logit models
6
6 STA 617 – Chp10 Models for matched pairs Log-linear model Chapters 8-9 Two-way table Three-way tables Multi-way tables Model selection Ordinal responses Log-linear model for rates SAS: genmod
7
7 STA 617 – Chp10 Models for matched pairs By far – cross sectional data If the data are collected over time, the data for the same subject in different time points will be correlated. Longitudinal data Multivariate responses * Non-linear models *
8
8 STA 617 – Chp10 Models for matched pairs Longitudinal data Chapter 10 – two time points: matched pairs Chapter 11 – repeated measures using marginal models (no random effects) Chapter 12 – random effect model or generalized linear mixed models Recent developments – publications for categorical responses since 2002 (final project) Read one or two recent papers 20 minutes presentation
9
9 STA 617 – Chp10 Models for matched pairs models Linear model (LMs) (t-tests, ANOVA, ANCOVA) SAS: proc TTEST, ANOVA, REG, GLM Generalized linear models (GLMs) SAS: proc GENMOD, LOGISTIC, CATMOD Linear mixed model (LMMs) – permitting heterogeneity of variance, variance structure is based on random effects and their variance components SAS: proc MIXED Generalized linear mixed models (GLMMs) SAS: proc NLMIXED Non-linear mixed model SAS: proc NLMIXED
10
10 STA 617 – Chp10 Models for matched pairs Models for matched pairs In this chapter, we introduce methods for comparing categorical responses for two samples when each observation in one sample pairs with an observation in the other. For easy understanding, we assume n independent subjects and let Y i = (Y i1,Y i2,...,Y iti ) is the observation of subject i at different time. In statistics, {Y 1,Y 2,...,Y n } are called longitudinal data For fixed i, Y i is a time series; for fixed time j, {Y 1j,Y 2j,...,Y nj } is a sequence of independent random variables. If t i = 2 for all i, {Y 1,Y 2,...,Y n } is called matched-pairs data. Note that the two samples {Y 11,Y 21,...,Y n1 } and {Y 12,Y 22,...,Y n2 } are not independent.
11
11 STA 617 – Chp10 Models for matched pairs Outline 10.1 Comparing Dependent Proportions; 10.2 Conditional Logistic Regression for Binary Matched Pairs; 10.3 Marginal Models for Squared Contingency Tables; 10.4 Symmetry, Quasi-symmetry and Quasi- independence; 10.5 Measure Agreement Between Observers; 10.6 Bradley-Terry Models for Paired Preferences.
12
12 STA 617 – Chp10 Models for matched pairs
13
13 STA 617 – Chp10 Models for matched pairs
14
14 STA 617 – Chp10 Models for matched pairs 10.1 COMPARING DEPENDENT PROPORTIONS
15
15 STA 617 – Chp10 Models for matched pairs
16
16 STA 617 – Chp10 Models for matched pairs
17
17 STA 617 – Chp10 Models for matched pairs
18
18 STA 617 – Chp10 Models for matched pairs 10.1.2 Prime minister approval rating example
19
19 STA 617 – Chp10 Models for matched pairs SAS code /*section 10.1.2 page 411*/ data tmp; p11=794/1600; p12=150/1600; p21=86/1600; p22=570/1600; p1plus=p11+p12; pplus1=p11+p21; se=sqrt( ((p12+p21)-(p12-p21)**2)/1600); lci=p1plus-pplus1-1.96*se; uci=p1plus-pplus1+1.96*se; z0=(86-150)/(86+150)**0.5; McNemarsTest=z0**2; pvalue=1-cdf('chisquare',McNemarsTest,1); se_ind=sqrt(p1plus*(1-p1plus)+ pplus1 *(1- pplus1 ))/sqrt(1600); /*assume independent*/ lci_ind=p1plus-pplus1-1.96*se_ind; uci_ind=p1plus-pplus1+1.96*se_ind; proc print; run;
20
20 STA 617 – Chp10 Models for matched pairs SAS code McNemar’s Test data matched; input first second count @@; datalines; 1 1 794 1 2 150 2 1 86 2 2 570 ; proc freq; weight count; tables first*second/ agree; exact mcnem; /*McNemars Test*/ proc catmod; weight count; response marginals; model first*second= (1 0, 1 1) ; run;
21
21 STA 617 – Chp10 Models for matched pairs PROC FREQ For square tables, the AGREE option in PROC FREQ provides the McNemar chi-squared statistic for binary matched pairs, the X 2 test of fit of the symmetry model (also called Bowker’s test), and Cohen’s kappa and weighted kappa with SE values. The MCNEM keyword in the EXACT statement provides a small-sample binomial version of McNemar’s test. PROC CATMOD provide the confidence interval for the difference of proportions. The code forms a model for the marginal proportions in the first row and the first column, specifying a model matrix in the model statement that has an intercept parameter (the first column) that applies to both proportions and a slope parameter that applies only to the second; hence the second parameter is the difference between the second and first marginal proportions.
22
22 STA 617 – Chp10 Models for matched pairs 10.1.3 Increased precision with dependent samples
23
23 STA 617 – Chp10 Models for matched pairs
24
24 STA 617 – Chp10 Models for matched pairs Fit marginal model data matched1; input case occasion response count @@; datalines; 1 0 1 794 1 1 1 794 2 0 1 150 2 1 0 150 3 0 0 86 3 1 1 86 4 0 0 570 4 1 0 570 ; proc logistic data=matched; weight count; model response=occasion; run; Xt proc genmod data=matched1 DESCENDING; weight count; model response=occasion/dist=bin link=identity;
25
25 STA 617 – Chp10 Models for matched pairs Google calculator ln((880 * 656) / (944*720) )= -0.163294682
26
26 STA 617 – Chp10 Models for matched pairs
27
27 STA 617 – Chp10 Models for matched pairs
28
28 STA 617 – Chp10 Models for matched pairs
29
29 STA 617 – Chp10 Models for matched pairs
30
30 STA 617 – Chp10 Models for matched pairs
31
31 STA 617 – Chp10 Models for matched pairs Matlab code for deriving previous MLE and SE % page 417 syms b n21 n12 LL=log(exp(b)^n21/(1+exp(b))^(n12+n21)); simplify(diff(LL,'b')) %result (n21-exp(b)*n12)/(1+exp(b)) %thus beta=log(n21/n12) simplify(diff(diff(LL,'b'),'b')) %result -exp(b)*(n12+n21)/(1+exp(b))^2
32
32 STA 617 – Chp10 Models for matched pairs 10.2.4 Random effects in binary matched-pairs model An alternative remedy to handling the huge number of nuisance parameters in logit model (10.8) treats as random effects. Assume ~ This model is an example of a generalized linear mixed model, containing both random effects and the fixed effect beta. Fit by proc NLMIXED Chapter 12
33
33 STA 617 – Chp10 Models for matched pairs 10.2.5 Logistic Regression for Matched Case–Control Studies The two observations in a matched pair need not refer to the same subject. For instance, case-control studies that match a single control with each case yield matched-pairs data. Example: A case-control study of acute myocardial infarction (MI) among Navajo Indians matched 144 victims of MI according to age and gender with 144 people free of heart disease.
34
34 STA 617 – Chp10 Models for matched pairs Now, for subject t in matched pair i, consider the model the conditional ML estimate of OR is
35
35 STA 617 – Chp10 Models for matched pairs 10.2.6 Conditional ML for matched pairs with multiple predictors
36
36 STA 617 – Chp10 Models for matched pairs 10.2.7 Marginal models vs. conditional models Section 10.1 Marginal model (McNemar’s test H0: =0) Section 10.2 conditional model Conditional ML Random effects, NLMIXED
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.