MoreEx - var avg; histogram / normal; run; r *b; %macro...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
* 1; * a; Proc format; value addstat 1='gluten' 2='barley' 3='potato' 4='none'; run; quit; q data dough; infile 'K:\6360\InClassExercise\Exercise7\doughrise1.txt' firstobs=5; input day add time; format add addstat.; run; r data dough2; infile 'K:\6360\InClassExercise\Exercise7\doughrise2.txt' firstobs=2; input day temp; run; r data doughcombo; merge dough dough2; by day; run; r * b-d; %macro getproc(data=, proc=, y=, x=, type=); % %if &proc=means %then %do; proc means data=&data; class &type; var &y; run; %end; % %else %if &proc=glm %then %do; proc glm data=&data; class &type; model &y=&type; means &type /tukey alpha=0.1; run; %end; % %else %do; proc reg data=&data; model &y = &x; run; %end; %mend getproc; % *b; %getproc(data=doughcombo, proc=means, y=time, x=temp, type=add); quit; q *c; %getproc(data=doughcombo, proc=reg, y=time, x=temp, type=add); quit; q
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
*d; %getproc(data=doughcombo, proc=glm, y=time, x=temp, type=add); quit; q *2; *a; data dist; d do i=1 to 100; avg=0; do j=1 to 2; avg=avg+rand('uniform'); end; avg=avg/2; output; drop i j; end; run; r title 'uniform'; proc univariate data=dist noprint;
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: var avg; histogram / normal; run; r *b; %macro clt(n=, repeats=); % data dist; d do i=1 to &repeats; avg=0; do j=1 to &n; avg=avg+rand('uniform'); end; avg=avg/&n; output; drop i j; end; run; r title 'uniform'; proc univariate data=dist noprint; var avg; histogram / normal; run; r %mend clt; % %clt(n=10, repeats=100); quit; q * general; %macro clt(distn=, npar=, par1=, par2=, n=, repeats=); % data dist; d do i=1 to &repeats; avg=0; do j=1 to &n; if &npar=0 then avg=avg+rand(&distn); else if &npar=1 then avg=avg+rand(&distn,&par1); a else avg= avg+rand(&distn,&par1,&par2); end; avg=avg/&n; output; drop i j; end; run; r title "&distn"; proc univariate data=dist noprint; var avg; histogram / normal; run; r %mend clt; % %clt(distn='uniform',npar=0,par1=0,par2=0,n=10,repeats=100); run; quit; q %clt(distn='bernoulli',npar=1,par1=0.5,par2=0,n=10,repeats=100); run; quit; q %clt(distn='beta',npar=2,par1=2,par2=2,n=10,repeats=100); run; quit;...
View Full Document

This note was uploaded on 06/06/2011 for the course STAT 4360 taught by Professor Park during the Spring '11 term at UGA.

Page1 / 3

MoreEx - var avg; histogram / normal; run; r *b; %macro...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online