Using PROC UNIVARIATE and the HISTOGRAM statement, determine whether the log transformations of price and carat result in relatively more normal data.
The analysis variables are: price, lprice, carat, lcarat.
You can execute the analysis for the four variables in one PROC or four separate PROCs, one for each variable.
The goal is to determine the effectiveness of the log transformation.
ods select
statement to return only the normality tests (testsfornormality
) and the histograms (histogram
).normaltest
option for PROC UNIVARIATE to display the tests for normality.normal
option for the histogram to plot a normal density curve against the data. Remember this requires a /
noprint
option within the normal
option in order to supress tests of the data fit against the normal density curve. Remember that sub-options within an option require parentheses.The PROC UNIVARIATE documentation is here.
Screenshot the output.
Then, based on the output, answer the following questions:
Screenshot the output.
Answer the following question:
Create another temporary dataset that takes the square root of carat and price. SQRT()
is the SAS function, or you can exponentiate with **(1/2)
. Be sure to include the log transformed in the dataset as well (see Parts 4 and 5).
Use PROC CORR to compute Pearson’s r correlation coefficient with four variables: lprice, lcarat, the square root of price, and the square root of carat. Suppress the simple statistics in the output.
Using the output, answer the following questions. Remember, we are only interested in how carat size influences the price of the diamond. This means we are not interested in whether there is a relationship between price and the square root of price, for example. There will be, but it doesn’t have any practical implications.
Use either PROC CORR or PROC SGSCATTER to create a correlation matrix with scatterplots for the same four variables. Include histograms of the data on the diagonal of the matrix. You do not need to “prettify” the output.
Screenshot the output.
Answer the following questions:
Your submission should include:
Upload to Blackboard!