Transcription of Introduction to Categorical Data Analysis Procedures
1 Chapter 5 Introduction to Categorical DataAnalysis ProceduresChapter Table of 65 SAMPLING FRAMEWORKS AND DISTRIBUTION 67 Simple Random Sampling: One Population .. 67 Stratified Simple Random Sampling: Multiple 68 Observational data : Analyzing the Entire Population .. 69 Randomized Experiments .. 70 RelaxationofSamplingAssumptions .. 70 COMPARISON OF FREQ AND CATMOD 71 COMPARISON OF CATMOD, GENMOD, LOGISTIC, AND 72 Logistic 73 Parameterization .. 7464 Chapter 5. Introduction to Categorical data Analysis ProceduresSAS OnlineDoc : Version 8 Chapter 5 Introduction to Categorical DataAnalysis ProceduresOverviewSeveral Procedures in SAS/STAT software can be used for the Analysis of categoricaldata:CATMOD fits linear models to functions of Categorical data , facilitating suchanalyses as regression, Analysis of variance, linear modeling, log-linear modeling, logistic regression, and repeated measures anal-ysis. Maximum likelihood estimation is used for the Analysis oflogits and generalized logits, and weighted least squares Analysis isused for fitting models to other response simple and multiple correspondence analyses, using acontingency table, Burt table, binary table, or raw Categorical dataas input.
2 For more on PROC CORRESP, see Chapter 6, Introduc-tion to Multivariate Procedures , and Chapter 24, The CORRESPP rocedure, .FREQ builds frequency tables or contingency tables and produces numer-ous tests and measures of association including chi-square statis-tics, odds ratios, correlation statistics, and Fisher s exact test forany size two-way table. In addition, it performs stratified analy-sis, computing Cochran-Mantel-Haenszel statistics and estimatesof the common relative risk. It performs a test of binomial propor-tions, computes measures of agreement such as McNemar s test,kappa, and weighted generalized linear models with maximum-likelihood family includes logistic, probit, and complementary log-logregression models for binomial data , Poisson regression models forcount data , and multinomial models for ordinal response data . Itperforms likelihood ratio and Wald tests for type I, type III, anduser-defined contrasts. It analyzes repeated measures data withgeneralized estimating equation (GEE) linear logistic regression models for binary or ordinal responsedata with maximum-likelihood methods.
3 It performs stepwise re-gression and provides regression diagnostics. The logit link func-tion in the logistic regression models can be replaced by the normitfunction or the complementary log-log Chapter 5. Introduction to Categorical data Analysis ProceduresPROBIT computes maximum-likelihood estimates of regression parametersand optional threshold parameters for binary or ordinal Procedures that perform analyses for Categorical data are the TRANSREG andPRINQUAL Procedures . PROC PRINQUAL is summarized in Chapter 6, Introduc-tion to Multivariate Procedures , and PROC TRANSREG is summarized in Chap-ter 3, Introduction to Regression Procedures . Acategorical variableis defined as one that can assume only a limited number ofdiscrete values. The measurement scale for such a variable is unrestricted. It can benominal, which means that the observed levels are not ordered. It can beordinal,which means that the observed levels are ordered in some way. Or it can beinterval,which means that the observed levels are ordered and numeric and that any intervalof one unit on the scale of measurement represents the same amount, regardless ofits location on the scale.
4 One example of a Categorical variable is litter size; anotheris the number of times a subject has been married. A variable that lies on a nominalscale is sometimes called aqualitativeorclassification data result from observations on multiple subjects where one or morecategorical variables are observed for each subject. If there is only one categoricalvariable, then the data are generally represented by afrequency table, which lists eachobserved value of the variable and its frequency of there are two or more Categorical variables, then a subject sprofileis defined asthe subject s observed values for each of the variables. Such Categorical data can berepresented by a frequency table that lists each observed profile and its frequency there are exactly two Categorical variables, then the data are often represented bya two-dimensionalcontingency table, which has one row for each level of variable 1and one column for each level of variable 2. The intersections of rows and columns,calledcells, correspond to variable profiles, and each cell contains the frequency ofoccurrence of the corresponding there are more than two Categorical variables, then the data can be represented byamultidimensional contingency table.
5 There are two commonly used methods fordisplaying such tables, and both require that the variables be divided into two the first method, one set contains a row variable and a column variable for a two-dimensional contingency table, and the second set contains all of the other variables in the second set are used to form a set of profiles. Thus, the data arerepresented as a series of two-dimensional contingency tables, one for each is the data representation used by PROC FREQ. For example, if you requesttables for RACE*SEX*AGE*INCOME, the FREQ procedure represents the data asa series of contingency tables: the row variable is AGE, the column variable is IN-COME, and the combinations of levels of RACE and SEX form a set of the second method, one set contains the independent variables, and the other setcontains the dependent variables. Profiles based on the independent variables arecalledpopulation profiles, whereas those based on the dependent variables are calledSAS OnlineDoc : Version 8 Simple Random Sampling: One Population 67response profiles.
6 A two-dimensional contingency table is then formed, with onerow for each population profile and one column for each response profile. Since anysubject can have only one population profile and one response profile, the contingencytable is uniquely defined. This is the data representation used by PROC Frameworks and Distribution As-sumptionsThis section discusses the sampling frameworks and distribution assumptions for theCATMOD and FREQ Random Sampling: One PopulationSuppose you take a simple random sample of 100 people and ask each person thefollowing question: Of the three colors red, blue, and green, which is your favorite?You then tabulate the results in a frequency table as shown in Table Frequency TableFavorite the population you are sampling, you assume there is an unknown probability thata population member, selected at random, would choose any given color. In order toestimate that probability, you use the sample proportionpj=njnwherenjis the frequency of thejth response andnis the total of the random variation inherent in any random sample, the frequencieshave a probability distribution representing their relative frequency of occurrence ina hypothetical series of samples.
7 For a simple random sample, the distribution offrequencies for a frequency table with three levels is as follows. The probability thatthe first frequency isn1, the second frequency isn2, and the third isn3=n n1 n2where jis the true probability of observing thejth response level in the (n1;n2;n3)=n!n1!n2!n3! n11 n22 n33 This distribution, called themultinomial distribution, can be generalized to any num-ber of response levels. The special case of two response levels is called OnlineDoc : Version 868 Chapter 5. Introduction to Categorical data Analysis ProceduresSimple random sampling is the type of sampling required by PROC CATMOD whenthere is one population. PROC CATMOD uses the multinomial distribution to esti-mate a probability vector and its covariance matrix. If the sample size is sufficientlylarge, then the probability vector is approximately normally distributed as a result ofcentral limit theory. PROC CATMOD uses this result to compute appropriate teststatistics for the specified statistical Simple Random Sampling: Multiple PopulationsSuppose you take two simple random samples, fifty men and fifty women, and askthe same question as before.
8 You are now sampling two different populations thatmay have different response probabilities. The data can be tabulated as shown inTable 5. Contingency Table: Sex by ColorFavorite ColorSexRedBlueGreenTotalMale30101050 Female20102050 Total502030100 Note that the row marginal totals (50, 50) of the contingency table are fixed by thesampling design, but the column marginal totals (50, 20, 30) are random. Thereare six probabilities of interest for this table, and they are estimated by the sampleproportionspij=nijniwherenijdenote s the frequency for theith population and thejth response, andniis the total frequency for theith population. For this contingency table, the sampleproportions are shown in Table of Sample Proportions by SexFavorite probability distribution of the six frequencies is theproduct multinomial distri-butionPr(n11;n12;n13;n21;n22;n23) =n1!n2! n1111 n1212 n1313 n2121 n2222 n2323n11!n12!n13!n21!n22!n23!SAS OnlineDoc : Version 8 Observational data : Analyzing the Entire Population 69where ijis the true probability of observing thejth response level in theith pop-ulation.
9 The product multinomial distribution is simply the product of two or moreindividual multinomial distributions since the populations are independent. This dis-tribution can be generalized to any number of populations and response simple random sampling is the type of sampling required by PROC CAT-MOD when there is more than one population. PROC CATMOD uses the productmultinomial distribution to estimate a probability vector and its covariance matrix. Ifthe sample sizes are sufficiently large, then the probability vector is approximatelynormally distributed as a result of central limit theory, and PROC CATMOD usesthis result to compute appropriate test statistics for the specified statistical statistics are known as Wald statistics, and they are approximately distributed aschi-square when the null hypothesis is data : Analyzing the Entire PopulationSometimes the observed data do not come from a random sample but instead rep-resent a complete set of observations on some population.
10 For example, suppose aclass of 100 students is classified according to sex and favorite color. The results areshown in Table this case, you could argue that all of the frequencies are fixed since the entirepopulation is observed; therefore, there is no sampling error. On the other hand,you could hypothesize that the observed table has only fixed marginals and that thecell frequencies represent one realization of a conceptual process of assigning colorpreferences to individuals. The assignment process is open to hypothesis, whichmeans that you can hypothesize restrictions on the joint Contingency Table: Sex by ColorFavorite ColorSexRedBlueGreenTotalMale16212057 Female12201143 Total284131100 The usual hypothesis (sometimes calledrandomness) is that the distribution of thecolumn variable (Favorite Color) does not depend on the row variable (Sex). Thisimplies that, for each row of the table, the assignment process corresponds to a sim-ple random sample (without replacement) from the finite population represented bythe column marginal totals (or by the column marginal subtotals that remain aftersampling other rows).