- Abstract (1)
- Geomapping (2)
- SAS Code (9)
- SAS Macros (2)
- SAS Procedures (3)
- SQL (1)
- SQL - Oracle (1)
- 26.4.2008: Export SAS data into XML File
- 18.11.2007: Import external data or files into SAS using wildcards
- 8.11.2007: SAS Enterprise Guide 4.x & Autoexec.sas
- 25.2.2007: Sample Size Calculation
- 20.1.2007: SAS: Contour Plot with PROC GCONTOUR
- 15.1.2007: SAS: Using GOTO Statement in Macro Steps
- 12.1.2007: Using email functions with SAS
- 11.1.2007: SAS: Geomapping Process (Maps based on ZIP Code)
- 11.1.2007: SAS: Import and Export Data
- 10.1.2007: Key Functions in Oracle SQL
BI News
SAS Forum
SAS Programming
Sample Size Calculation
*
SAMPLE SIZE CALCULATION
How many customer should we randomly select to get significant results?
- Customer Base: 10.000 customer
- Standard Deviation calculated by PROC MEANS
- Probability value: 5%
- Margin of Error: 1 Euro
Detailed Documentation:
http://www.isixsigma.com/library/content/c000709a.asp
Simulation of Customer Base Table:
acct_num = Accountnumber
fee = monthly fee in Euro per customer
;
data customer_base(drop=i);
do i=1 to 10000 by 1;
acct_num=i;
fee= 100 + round(25*ranuni(1),1);
output;
end;
run;
proc means data=customer_base;
var fee;
title ‘Descriptive Statistics using Proc Means’;
output out=customer_statistics;
run;
*store Standard Deviation in macro variable for later calculations: ;
proc sql noprint;
select fee into :std
from customer_statistics
where _stat_=‘STD’
;
quit;
*
Calculation of the sample size:
sample_size = (critical value Z alpha/2 * Standard Deviation of the Population) / margin of the Error)**2
Z alpha/2 is calculated with the Table of Standard Normal Distribution
;
data sample_size;
sample_size=round(((1.96 * &std)/1)**2,1);
run;
* In this example a Minimum of 200 customers is needed to get significant results;