Fluorite | Level 6

## Calculating the standardized difference for an interval

Hi Community,

I am trying to test whether the distribution of reported earnings around zero earnings is abnormal just to the left of zero.  In other words, I am looking for irregularity near zero earnings. To test the significance of irregularity, I should calculate the standardized difference which is the difference between the actual number of observations and the expected number of observations in interval i divided by the estimated standard deviation. Now, as you see below, the syntax allows me to do the histogram for the distribution of two variables (Lagearnings1 and EB_ACFO ) with intervals that have equal width (0.01). But, I would like to know how to calculate the standardized difference for the interval just left (i.e. -0.01, 0.00) and just right (0.00, +0.01) to zero earnings? I attached a sample of my row data in case you want to test the data.

Thank you as always.

Ali

title "Distributions of scaled earnings and earnings before abnormal CFO";
proc sgplot data=compu_graph_EBACFO;
histogram Lagearnings1 / binwidth=0.01 binstart= -0.25 showbins transparency=0.4
name="Scaled earnings" legendlabel="Scaled earnings";
histogram EB_ACFO / binwidth=0.01 binstart= -0.25 showbins transparency=0.5
name="Earnings before abnormal CFO" legendlabel="Earnings before abnormal CFO";
density Lagearnings1 / type=kernel lineattrs=GraphData1; /* optional */
density EB_ACFO / type=kernel lineattrs=GraphData2; /* optional */
xaxis values= (-0.25 to +0.25 by 0.01);
xaxis label="Interval width (0.01)" min=-0.25;
keylegend "Scaled earnings" "Earnings before abnormal CFO" / across=1 position=TopRight location=Inside;
run;

2 REPLIES 2
SAS Super FREQ

## Re: Calculating the standardized difference for an interval

In order to calculate "expected number of observations in interval," you must specify a statistical hypothesis that you can test. What model are you using? Are you looking for a deviation from normality?

Fluorite | Level 6

## Re: Calculating the standardized difference for an interval

Yes, please you can do. Thank you.

Ali

Discussion stats
• 2 replies
• 680 views
• 0 likes
• 2 in conversation