How do i write a code for the equation below:
|a - b| - E|a - b|.
where E represents an expectation operator, while a and b are variables
Thanks
Equation (3) is the PDF of the binomial distribution. In SAS, you can use the PDF function to compute the binomial density.
The standard definition is
pdf = PDF("Binomial", numSuccess, prob, NumTrials);
For your notation:
pdf = PDF("Binomial", X_it, P_Bar, N_it);
SAS does not have a way to compute expected values of a distribution.
Are you trying to use the "mean of the data" instead of the "Expected value of a distribution"?
Since E[A-B] = E[A] - E[B], this reduces to the expected value of a single random variable (rv).
If A and B are discrete r.v.'s, the expected value is a sum: E[X] = SUM( X_i * p_i ).
If they are continuous r.v.'s, then you are computing the means of the distributions. For many standard distributions, the mean has an explicit value in terms of the parameters of the distribution. For nonstandard distributions, you can compute the integral of x*f(x) over the support of the distribution. The QUAD function in SAS/IML can perform integrations like this.
Thanks for your response, i forgot to add that the expectation is calculated based on the
Binomial Distribution.
In the above question, i tried to simplify the real question.
please find attached pictures that explain the full question.
How do i find equation 2, especially the second term using SAS.
Thank you
Equation (3) is the PDF of the binomial distribution. In SAS, you can use the PDF function to compute the binomial density.
The standard definition is
pdf = PDF("Binomial", numSuccess, prob, NumTrials);
For your notation:
pdf = PDF("Binomial", X_it, P_Bar, N_it);
Thanks Rick for your response,
Please in using the pdf as you specified above, how do i determine P_bar (prob) ?
Thank you
The reference says that \bar{P}_t is the "cross-sectional average" of the P_{it}, which means averaged over the i, I suppose.
I don't have time to help you understand the paper, but perhaps others do. As always, the best way to get a good answer is to post data and the SAS code you are currently using. Good luck!
Thank you Rick, i did it with your help. Thanks again 👍
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.