How do I generate a new varaible in my dataset that has the quanitles of the normal distribution such that when I graph the new variable and the residuals I would get the equivalent of the qqplot statement in proc Univariate?
You can use the Quantile Function to compute quantiles of the Normal Distribution like this
data NormQuantiles;
do x=.025 to .975 by .025;
q=quantile('Normal', x, 0, 1);
output;
end;
run;
Regarding replicating a qqplot, please specify what model you run. Makes it easier to help you
You can use the Quantile Function to compute quantiles of the Normal Distribution like this
data NormQuantiles;
do x=.025 to .975 by .025;
q=quantile('Normal', x, 0, 1);
output;
end;
run;
Regarding replicating a qqplot, please specify what model you run. Makes it easier to help you
I think you gave me the answer that I need. All I would need to do is to replace the number in "by .025" in your example with 1/n where n is the number of observations in my dataset.
In response to your question:
I can get a qq plot in proc glm
.
proc glm plots=diagnostics;
model a=b c;
run;
I can also use Proc Univariate.
proc glm;
model a=b c;
output out=data2 r=resid;
run;
proc univariate;
var resid;
qqplot resid;
run;
The plot is not exactly equivalent as the diagnostic plot in Proc GLM has a line to indicate a normal distribution.
The goal is not to generate a qq plot. The qq plot from proc glm shows a clear break point where the slope of the plotted residuals changes. There is a possible biological explanation for this where light levels are insufficient to maintain C4 photosynthesis. I need to identify that break point in the data to see if that explanation works or not.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.