So if you assign a format to a variable with a FORMAT statement, PROC FREQ formats the values before dividing observations into the levels of a frequency or crosstabulation table. PROC FREQ uses the formatted values of the TABLES variable to determine the categorical variable levels. These variables can be either character or numeric, but the procedure treats them as categorical variables. The TABLES statement variables are one or more variables from the DATA= input data set. For example, the statements shown in Table 35.8 illustrate grouping syntax. To specify multiple table requests quickly, use a grouping syntax by placing parentheses around several variables and joining other variables or variable combinations. You can also specify any number of table requests in a single TABLES statement. PROC FREQ builds all the table requests in one pass of the data, so that there is essentially no loss of efficiency. You can use multiple TABLES statements in the PROC FREQ step. Each table lists the values for C down the side and the values for D across the top. For example, a specification of A* B* C* D in a TABLES statement produces k tables, where k is the number of different combinations of values for A and B. PROC FREQ produces a separate crosstabulation table for each stratum. Each level (or combination of levels) of the other variables forms one stratum. You can include up to 50 variables in a single multiway table request.įor two-way to multiway tables, the values of the last variable form the crosstabulation table columns, while the values of the next-to-last variable form the rows. The unique values of these variables form the rows, columns, and strata of the table. To request a multiway table (an n-way table, where n>2), separate the desired variables with asterisks. To request a two-way crosstabulation table, use an asterisk between two variables. To request a one-way frequency table, use a single variable. A request is composed of one variable name or several variable names separated by asterisks. Specify the frequency and crosstabulation tables to produce.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |