Skip to content

Instantly share code, notes, and snippets.

@ymattu
Last active January 15, 2016 17:41
Show Gist options
  • Save ymattu/57e7beca1300c0020566 to your computer and use it in GitHub Desktop.
Save ymattu/57e7beca1300c0020566 to your computer and use it in GitHub Desktop.
proc iml;
submit/R;
iris;
endsubmit;
run ImportDataSetFromR("work.iris","iris");
quit;
proc print data=iris(obs=30) /*データの確認(変数名など)*/
run;
ods graphics on;
proc mcmc data=iris outpost=irisout nmc=5000 thin=5 seed=123;
parms beta0 beta1 0;
parms sigma2 1;
prior beta0 beta1~ normal(mean=0, var=1e6);
prior sigma2 ~igamma(shape=3/10, scale=10/3);
mu = beta0 + beta1*Sepal_Width;
model Sepal_Length~n(mu, var=sigma2);
run;
ods graphics off;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment