![]() With 4 variables, the number of paired combinations increases to 4. When the above code is executed, we get the following result − Cross tabulation of 4 Variables Tables make * (type model) / nocol norow nopercent Also we use the nocol and norow option to avoid the sum and percentage values. In the below example we find the frequency of each type of car and each model of car with respect to the make of the car. So in the result we have two cross tables. ![]() When we have three variables we can group 2 of them and cross tabulate each of these two with the third varaible. When the above code is executed, we get the following result − Cross tabulation of 3 Variables SELECT make, type, invoice, horsepower, length, weight We can observer that the result shows values across the rows and the columns. In this case we need the individual frequency values as well as the sum of the frequency values across the makes and across the types. Variable_1 and Variable_2 are the variable names of the dataset whose frequency distribution needs to be calculated.Ĭonsider the case of finding how many car types are available under each car brand from the dataset cars1 which is created form SASHELP.CARS as shown below. The basic syntax for applying cross tabulation in SAS is −įollowing is the description of the parameters used − For example - if we need the frequency of each model for each make in each car type category, then we need to use the TABLES option of PROC FREQ. In SAS it is created using PROC FREQ along with the TABLES option. ![]() Cross tabulation involves producing cross tables also called contingent tables using all possible combinations of two or more variables.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |