NOTE: The data set WORK.DIFFS has 0 observations and 3 variables. NOTE: There were 31 observations read from the data set WORK.OUTCAT. NOTE: There were 31 observations read from the data set WORK.OUTEACH. In this example, our null hypothesis is that gender and political. proc compare noprint base=outEach compare=outCat out=diffs outnoequal Next, we can use the following code to perform Fisher’s Exact Test: /perform Fishers Exact test/ proc freq tables PartyGender / fisher run The results of the test are shown below: The null hypothesis for Fisher’s Exact Test is that the two variables are independent. If zero rows with differences (per noequal) then the out= data sets have identical counts. Reality check with COMPARE, I don't trust eyeballs. Tables crossing / list missing out=outCat Title "1 table - 1 column of concatenated crossings" at 17:55 Add a comment 3 Answers Sorted by: 2 Why not just use PROC SUMMARY instead Here is an example using two variables from SASHELP.CARS. This equates to both time saved as well as less opportunity for typos. Why might proc freq be a good candidate for these quick responses First, in these cases, there is less typing than other methods. data haveV / view=haveV Ĭrossing = catx(' * ', of s:) * concatenation of all the s variables Proc freq might not be the first method thought of to answer questions such as these, but it may be a very quick and efficient option to use. Tables s1*s2*s3*s4*s5 / list missing out=outEach Īnd, compare to what happens when a data step view uses a variable list to compute a surrogate value corresponding to the discrete combinations reported above. Now, reconsider the original request discretely (no-shortcut) crossing all the s* variables: title "1 table - 5 columns of crossings" So for above, the out= table will have a column "s5", but contain counts corresponding to combinations for each s1 through s5.Īt each dimensional level you can use a variable list, as in level1 * (sublev:) * leaf. NOTE: If you specify out=, the column names in the output data set will be the last variable in the level. ![]() There is no shortcut syntax for specifying a variable list that crosses dimension. ![]() Sample data generator: %macro have(top=5) Īs you probably noticed table s: created one freq per s* variable.įor example: title "One table per variable" In long, yes - if you create a surrogate variable that is an equivalent crossing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |