BookmarkSubscribeRSS Feed
Fluorite | Level 6

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.




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;


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

Yes, please you can do. Thank you.



Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2 in conversation