Here is an example of how do simulate data for a simple bivariate linear
model using SAS.  I use this macro to generate a different random sample for
each student in the class, with data posted on the web for them and with
solutions to me.  If you want a less hands-on approach, I recommend Drake
Bradley's DATASIM software.

TITLE1 'Simulation from Wuensch, Castellow, & Moore, JSB&P, 1991.'; %MACRO
MREG; DATA SOL; drop subject; 
DO subject = 1 TO 100; 
serious=round(5.5+1.6*NORMAL(0)); 
if serious > 9 then serious = 9;if serious < 1 then serious = 1; 
sentence = round(-.92+1.16*serious+2.78*NORMAL(0)); 
if sentence < 1 then sentence = 1;if sentence > 15 then sentence = 15;
OUTPUT;FILE "C:\SimData\%name.dat";PUT sentence serious; end;
TITLE3 "Analysis of Regression Data Given to %ST";   
PROC REG simple corr; MODEL sentence = serious; 
%MEND MREG; 

+++++++++++++++++++++++++++++++++++++++++
Karl L. Wuensch, Department of Psychology,
East Carolina University, Greenville NC  27858-4353
Voice:  252-328-4102     Fax:  252-328-6283
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>   
http://core.ecu.edu/psyc/wuenschk/klw.htm
<http://core.ecu.edu/psyc/wuenschk/klw.htm> 

Reply via email to