Example: air traffic controller

The FREQ Procedure - Worcester Polytechnic Institute

Chapter 28 The freq ProcedureChapter Table of ..1259 OUTPUTS tatement .. Frequency with Formats ..1278 MissingValues ..1279 StatisticalComputations ..1281 DefinitionsandNotation ..1281 Chi-SquareTestsandStatistics ..1282 Measures of Proportion ..1298 RisksandRiskDifferences ..1299 Odds Ratio and Relative Risks for 2 2 Tables ..1304 Tests and Measures of ..1324 DisplayedOutput ..1327 ODST ableNames ..13321246 Chapter 28. The freq Creating an Output Data Set with Table Cell Frequencies .. 1335 Example Computing Chi-square Tests for One-Way Frequency Tables.

1248 Chapter 28. The FREQ Procedure dependent or independent), the measurement scale of the variables (nominal, ordinal, or interval), the type of association that …

Tags:

  Worcester, Procedures, Institute, Worcester polytechnic institute, Polytechnic, Freq, The freq procedure

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of The FREQ Procedure - Worcester Polytechnic Institute

1 Chapter 28 The freq ProcedureChapter Table of ..1259 OUTPUTS tatement .. Frequency with Formats ..1278 MissingValues ..1279 StatisticalComputations ..1281 DefinitionsandNotation ..1281 Chi-SquareTestsandStatistics ..1282 Measures of Proportion ..1298 RisksandRiskDifferences ..1299 Odds Ratio and Relative Risks for 2 2 Tables ..1304 Tests and Measures of ..1324 DisplayedOutput ..1327 ODST ableNames ..13321246 Chapter 28. The freq Creating an Output Data Set with Table Cell Frequencies .. 1335 Example Computing Chi-square Tests for One-Way Frequency Tables.

2 1337 Example Computing Binomial Proportions for One-Way Frequency Ta-bles ..1339 Example Analyzing a 2x2 ContingencyTable ..1342 Example Creating an Output Data Set Containing Chi-Square Statistics . 1345 Example Computing Cochran-Mantel-Haenszel Statistics for a .. sChi-SquareStatistic ..1352 Example Testing Marginal Homogeneity with Cochran OnlineDoc : Version 8 Chapter 28 The freq ProcedureOverviewThe freq Procedure produces one-way ton-way frequency and crosstabulation(contingency) tables. For two-way tables, PROC freq computes tests and measuresof association.

3 Forn-way tables, PROC freq does stratified analysis, computingstatistics within, as well as across, strata. Frequencies and statistics can also be out-put to SAS data one-way frequency tables, PROC freq can compute statistics to test for equalproportions, specified proportions, or the binomial proportion. For contingency ta-bles, PROC freq can compute various statistics to examine the relationships be-tween two classification variables adjusting for any stratification variables. PROCFREQ automatically displays the output in a report and can also save the output in aSAS data some pairs of variables, you may want to examine the existence or the strengthof any association between the variables.

4 To determine if an association exists, chi-square tests are computed. To estimate the strength of an association, PROC freq computes measures of association that tend to be close to zero when there is no asso-ciation and close to the maximum (or minimum) value when there is perfect associa-tion. The statistics for contingency tables include chi-square tests and measures measures of association risks (binomial proportions) and risk differences for2 2tables odds ratios and relative risks for2 2tables tests for trend tests and measures of agreement Cochran-Mantel-Haenszel statisticsPROC freq computes asymptotic standard errors, confidence intervals, and tests formeasures of association and measures of agreement.

5 Exactp-values and confidenceintervals are available for various test statistics and measures. PROC freq alsoperforms stratified analyses that compute statistics within, as well as across, strata forn-way tables. The statistics include Cochran-Mantel-Haenszel statistics and measuresof choosing measures of association to use in analyzing a two-way table, you shouldconsider the study design (which indicates whether the row and column variables are1248 Chapter 28. The freq Proceduredependent or independent), the measurement scale of the variables (nominal, ordinal,or interval), the type of association that each measure is designed to detect, and anyassumptions required for valid interpretation of a measure.

6 You should exercise carein selecting measures that are appropriate for your comments apply to the choice and interpretation of the test statistics. Forexample, the Mantel-Haenszel chi-square statistic requires an ordinal scale for bothvariables and is designed to detect a linear association. The Pearson chi-square, onthe other hand, is appropriate for all variables and can detect any kind of association,but it is less powerful for detecting a linear association because its power is dispersedover a greater number of degrees of freedom (except for2 2tables).

7 Several SAS procedures produce frequency counts; only PROC freq computes chi-square tests for one-way ton-way tables and measures of association and agreementfor contingency tables. Other procedures to consider for counting are TABULATE,CHART, and UNIVARIATE. When you want to fit models to categorical data, use aprocedure such as CATMOD, GENMOD, LOGISTIC, PHREG, or more information on selecting the appropriate statistical analyses, refer to Agresti(1996) or Stokes, Davis, and Koch (1995).Getting StartedFrequency Tables and StatisticsThe freq Procedure provides easy access to statistics for testing for association in acrosstabulation this example, high school students applied for courses in a summer enrichmentprogram: these courses included journalism, art history, statistics, graphic arts, andcomputer programming.

8 The students accepted were randomly assigned to classeswith and without internships in local companies. The following table contains countsof the students who enrolled in the summer program by gender and whether they wereassigned an internship Enrichment DataEnrollmentGenderInternshipYe sN oTo t a lboysyes352964boysno142741girlsyes321032 girlsno532376 The SAS data setSummerSchoolis created by inputting the summer enrichmentdata as cell count data, or providing the frequency count for each combinationof variable values.

9 The following DATA step statements create the SAS data OnlineDoc : Version 8 Frequency Tables and Statistics 1249data SummerSchool;input Gender $ Internship $ Enrollment $ Count @@;datalines;boys yes yes 35 boys yes no 29boys no yes 14 boys no no 27girls yes yes 32 girls yes no 10girls no yes 53 girls no no 23;The variableGendertakes the values boys or girls , the variableInternshiptakesthe values yes and no , and the variableEnrollmenttakes the values yes and no . The variableCountcontains the number of students corresponding to eachcombination of data values.

10 The double at sign (@@) indicates that more than oneobservation is included on a single data line. In this DATA step, two observations areincluded on each are interested in whether there is an association between internship statusand summer program enrollment. The Pearson chi-square statistic is an appropriatestatistic to assess the association in the corresponding2 2table. The followingPROC freq statements specify this specify the table for which you want to compute statistics with the TABLES statement. You specify the statistics you want to compute with options after a slash(/) in the TABLES freq data=SummerSchool order=data;weight count;tables Internship*Enrollment / chisq;run;The ORDER= option controls the order in which variable values are displayed in therows and columns of the table.


Related search queries