So I'm trying to create a sample using SAS. I'm using a Sample Size formula defined below. But I get errors saying that the Eval has characters instead of numbers but I dont think it's true, also one of the other errors are in my options for the proc Surveyselect it says they don't belong? but I think they do, based on the Proc Surveyselect resources. any help would be appreciated. Here is the Code, I'm using the Pg2 library from the 2nd lesson: %let Z = 1.96; %let P = 0.05; %let E = 0.05; proc sql noprint; select count(*) into :N from pg2.class_birthdate; quit; %let Sample_Size = %eval((&N * ((&E * (1 - &E)) / (&P / &Z) ** 2)) / (((&E * (1 - &E)) / ((&P / &Z) ** 2)) + &N - 1)); %put Sample Size: &Sample_Size; data SampledClass; proc surveyselect data=pg2.class_birthdate method=srs out=SampledClass sampsize= &sample_size seed=1234; run; proc print data=SampledClass; run;
... View more