/* Weed seeds example */ /* Number of weed seeds in 98 quatrer ounce batches of grass. These data are in summary form. response variable: number = number of weed seeds in a quarter ounce batche of grass count = frequency */ /* -------------------------------------------------- */ data weedseeds; input number count; cards; 0 37 1 32 2 16 3 9 4 2 5 0 6 1 7 1 ; /* -------------------------------------------------- */ /* these lines create the SAS data set named "weedseeds" the input line names the variables and indicates their order in the data file or datalines the data values are on the lines (datalines) following the "cards;" line and the ";" line These data are in summary form with the counts (frequencies) for each of the values of the response variable */ /* -------------------------------------------------- */ /* The following proc sgplot paragraph requests a histogram for the distribution of number = the number of weed seeds in a batch "freq=count" indicates that the variable count contains the frequencies (counts) "datalabel=percent" requests that percentages be indicates on the histogram the "density" command requests a smooth curve to approximate the shape of the histogram (a kernel density estmate) */ /* -------------------------------------------------- */ proc sgplot data=weedseeds; title 'weed seed distribution'; histogram number / freq=count datalabel=percent; density number / freq=count type=kernel; /* -------------------------------------------------- */ /* The following proc sgplot paragraph requests a horizontal box plot for the distribution of number = the number of weed seeds in a batch "freq=count" indicates that the variable count contains the frequencies (counts) */ /* -------------------------------------------------- */ proc sgplot data=weedseeds; title 'weed seed distribution'; hbox number / freq=count; /* -------------------------------------------------- */ /* The following proc univariate paragraph requests numerical summary information about the the distribution of number = the number of weed seeds in a batch "var number" indicates that number is the response variable "freq = count" indicates that the data are in summary form with frequencies in the variable count */ /* -------------------------------------------------- */ proc univariate data=weedseeds; var number; freq count;