Chapter Contents |
Previous |
Next |

The FREQ Procedure |

Procedure features: |
| ||||||||||||||||||||

Other features: |
| ||||||||||||||||||||

Data set: |
COLOR |

This example

- creates a
3×5 contingency table showing the joint frequency
distribution for two variables
- suppresses the row and column percentages for each cell
- displays the expected frequency for each
cell
- displays each cell's contribution to the total Pearson chi-square
statistic
- creates an output data set with Pearson chi-square and likelihood-ratio
chi-square statistics
- displays the output data set.

Program |

options nodate pageno=1 pagesize=60; proc freq data=color order=data; weight count; |

tables eyes*hair /chisq expected cellchi2 norow nocol; |

output out=chisqdat pchi lrchi n nmiss; title 'Chi-Square Tests for 3 by 5 Table of Eye and Hair Color'; run; |

proc print data=chisqdat noobs; title 'Chi-Square Statistics for Eye and Hair Color'; title2 'Output Data Set from the FREQ Procedure'; run; |

Output |

The output data set has one observation that contains the sample size, number of missing observations, and chi-square statistics with the corresponding degrees of freedom and probability values. | |

Chapter Contents |
Previous |
Next |
Top of Page |

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.