Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kurtosis SAS. g1g2.sas; data EDA; infile 'C:\Users\Vati\Documents\StatData\EDA.d at'; input Y; proc means mean skewness kurtosis N; var Y; run; Analysis.

Similar presentations


Presentation on theme: "Kurtosis SAS. g1g2.sas; data EDA; infile 'C:\Users\Vati\Documents\StatData\EDA.d at'; input Y; proc means mean skewness kurtosis N; var Y; run; Analysis."— Presentation transcript:

1 Kurtosis SAS

2 g1g2.sas; data EDA; infile 'C:\Users\Vati\Documents\StatData\EDA.d at'; input Y; proc means mean skewness kurtosis N; var Y; run; Analysis Variable : Y MeanSkewnessKurtosisN 72.51041670.52556890.032366896

3 Standardize the Scores PROC STANDARD data=eda mean=0 std=1 out=z_scores; run; proc means mean skewness kurtosis N; var Y; run; Analysis Variable : Y MeanSkewnessKurtosisN -4.09395E-160.52556890.032366896 Note: No change in values of Skewness and Kurtosis.

4 Compute  z 3 &  z 4 data z34; set z_scores; Z3=Y**3; Z4=Y**4; proc means data=z34 noprint; var Z3 Z4; output out=sumZ34 N=N N4 sum=sumZ3 sumZ4; run;

5 Compute g 1 & g 2 data skew; set sumz34; G1=N/(n-1)/(n- 2)*sumZ3; G2=N*(n+1)/(n-1)/(n-2)/(n-3)*sumZ4 - 3*(n-1)*(n-1)/(n-2)/(n-3); proc print; run; NN4sumZ3sumZ4G1G2 96 48.8889279.1030.525570.032367 Same values as computed with Proc Means.

6 Create Large Uniform Sample DATA uniform; DROP N; DO N=1 TO 500000; X=UNIFORM(0); OUTPUT; END; PROC MEANS mean std skewness kurtosis; VAR X; run; Analysis Variable : X MeanStd DevSkewnessKurtosis 0.50027710.28885930.0012401-1.2009090 Skewness and Kurtosis have their expected values, 0 and -1.2.

7 *Kurtosis-T.sas; *************************************************************** options formdlim='-' pageno=min nodate; TITLE 'T ON 9 DF, T COMPUTED ON EACH OF 500,000 SAMPLES'; TITLE2 'EACH WITH 10 SCORES FROM A STANDARD NORMAL POPULATION'; run; DATA T9; DROP N; DO SAMPLE=1 TO 500000; DO N=1 TO 10; X=NORMAL(0); OUTPUT; END; END; PROC MEANS NOPRINT; OUTPUT OUT=TS T=T; VAR X; BY SAMPLE; PROC MEANS MEAN STD N KURTOSIS; VAR T; run;

8 Analysis Variable : T MeanStd DevNKurtosis -0.00071.135455000001.23472 Student’s t on 9 df

9 DATA T16; DROP N; DO SAMPLE=1 TO 500000; DO N=1 TO 17; X=NORMAL(0); OUTPUT; END; END; PROC MEANS NOPRINT; OUTPUT OUT=TS T=T; VAR X; BY SAMPLE; TITLE 'T ON 16 DF, SAMPLING DISTRIBUTION OF 500,000 TS'; run; PROC MEANS MEAN STD N KURTOSIS; VAR T; run; Analysis Variable : T MeanStd DevNKurtosis 0.0004241.067085000000.47135

10 DATA T28; DROP N; DO SAMPLE=1 TO 500000; DO N=1 TO 29; X=NORMAL(0); OUTPUT; END; END; PROC MEANS NOPRINT; OUTPUT OUT=TS T=T; VAR X; BY SAMPLE; TITLE 'T ON 28 DF, SAMPLING DISTRIBUTION OF 500,000 TS'; run; PROC MEANS MEAN STD N KURTOSIS; VAR T; run; Analysis Variable : T MeanStd DevNKurtosis 0.0003211.037275000000.24623

11 *Kurtosis_Beta2.sas; *Illustrates the computation of population kurtosis; *Using data from the handout Skewness, Kurtosis, and the Normal Curve; data A; do s=1 to 20; X=5; output; X=15; output; end; *Creates distribution with 20 scores of 5 and 20 of 15; data ZA; set A; Z=(X-10)/5; Z4A=Z**4; *Changes score to z scores and then raises them to the 4 th power; proc means mean; var Z4A; run; *Finds the mean (aka ‘expected value’) of z**4; Analysis Variable: Z4A Mean 1.0000000  2 = 1,  2 =  2 -3 = -2

12 The rest of the program uses the same definition of  2 to verify the values of  2 reported in the handout.

13 *Kurtosis-Normal.sas; ************************************************************************** options formdlim='-' pageno=min nodate; TITLE 'Skewness and Kurtosis for 100,000 Samples of 1000 Scores Drawn From a Normal (0,1) Distribution'; run; DATA normal; DROP N; DO SAMPLE=1 TO 100000; DO N=1 TO 1000; X=NORMAL(0); OUTPUT; END; END; PROC MEANS NOPRINT; OUTPUT OUT=SK_KUR SKEWNESS=SKEWNESS KURTOSIS=KURTOSIS; VAR X; BY SAMPLE; PROC MEANS MEAN STD N; VAR skewness kurtosis; run;


Download ppt "Kurtosis SAS. g1g2.sas; data EDA; infile 'C:\Users\Vati\Documents\StatData\EDA.d at'; input Y; proc means mean skewness kurtosis N; var Y; run; Analysis."

Similar presentations


Ads by Google