Skip to content

Instantly share code, notes, and snippets.

@ymattu
Last active January 16, 2016 23:04
Show Gist options
  • Save ymattu/2f4fa98f61d17d1c2bf9 to your computer and use it in GitHub Desktop.
Save ymattu/2f4fa98f61d17d1c2bf9 to your computer and use it in GitHub Desktop.
proc iml;
submit/R;
airquality;
endsubmit;
run ImportDataSetFromR("work.air","airquality");
quit;
proc print data=air(obs=30); /*データの確認(変数名など)*/
run;
ods graphics on;
proc mcmc data=air outpost=airout 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*Solar_R;
model Ozone~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