Hi Reeza, I modify the code as you comment below: It works and almost there as oputput of skewdata includes observation 13 to 22 which looks redundant. I'll try to fix it and really appreciate your support! PROC SQL;
CREATE TABLE work.query AS
SELECT j , i , X , Y FROM MYSECOND.SPC;
/*WHERE J=&j AND Y=0;*/
RUN;
QUIT;
/*PROC DATASETS NOLIST NODETAILS;
CONTENTS DATA=work.query OUT=WORK.details;
RUN;
PROC PRINT DATA=WORK.details;
RUN;*/ /*No need to print work.detail*/
ods noproctitle;
ods graphics / imagemap=on;
proc means data=work.query chartype NWAY mean std min max n vardef=df skew SKEWNESS KURT KURTOSIS;
var X;
output out=work.skewtemp skew=Distskew KURT=DISKURT ;where (j between 0 and 10) and Y=0; class J;
run;
data skewdata;
set skewtemp;
/*MODIFY skewdata;*/
SKEWSQUARE=Distskew*Distskew;
Excess_Kurt=DISKURT+3;
/*output;*/
run; /*How to "amend" the file skewdata?*/
proc append base=work.skewdata data=work.skewtemp force;
run;
proc print data=work.skewdata;
run;
run;
ods graphics / reset imagemap;
/*--SGPLOT proc statement--*/
proc sgplot data=WORK.QUERY;
/*--Histogram settings--*/
histogram X /;
/*--Vertical or Response Axis--*/
yaxis grid;
run;
ods graphics / reset;
... View more