Good evening
Considering that i have Poisson distribution. How can i calculate the Maximum Likelihood Estimators (MLE) for each of samples?
(there will be a total of 10,000 Maximum Likelihood Estimators since i have a 10,000 samples of size 25( n=25))
Thank in advanced 😊
Good evening, @Abdulaziz98, and welcome to the SAS Support Communities!
Create a SAS dataset ("HAVE") consisting of all 10,000 samples (i.e., 250,000 observations), sorted* by sample number, say, SAMPNO=1, ..., 10000. (You may already have some existing sample ID that you can use instead of SAMPNO.) Then use PROC SUMMARY to compute the sample means of the variable (let me call it X) containing the values from a Poisson distribution:
proc summary data=have;
by sampno;
var x;
output out=want(drop=_:) mean=MLE;
run;
The resulting dataset WANT will contain the maximum likelihood estimate (MLE) of the Poisson parameter for each sample, i.e., 10,000 observations with SAMPNO and MLE.
* Edit: If your dataset is not sorted, but grouped by sample number (i.e., the first 25 observations are from one sample, the next 25 constitute another sample and so on, but the sample numbers are not in ascending or descending order), add the keyword NOTSORTED to the BY statement:
by sampno notsorted;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.