> pnorm(c)If not, then we would do:
> pnorm(c,mu,sd)where c is the value of interest, mu is the mean of the sample, and sd is the standard deviation. In SAS, we can use the PROC IML step:
PROC IML;or
prob = CDF('Normal',c);
PRINT prob;
QUIT;
PROC IML;Example: If we let c = 1.96, mu = 0, and sd = 1, then the probability associated with this particular example is 0.975. You should get familiar with this number because, when we do a two-sided hypothesis test, we assume α = 0.05 and test for 100(1-α/2) = 100(1-0.05/2) = 0.975.
prob = CDF('Normal',c,mu,sd);
PRINT prob;
QUIT;
In the case where we want to determine the quantile associated with a particular probability, i.e. what is the 100(n)th percentile (assuming X follows a normal distribution of mean mu and standard deviation mu), then in R we use:
> qnorm(n,mu,sd)and in SAS we do:
PROC IML;NOTE: n is a value between 0 and 1. For example, if we are interested in the 90th percentile, then for either R or SAS, the input value is 0.90.
quant = QUANTILE('Normal',n,mu,sd);
PRINT quant;
QUIT;
No comments:
Post a Comment