Skip to content

Instantly share code, notes, and snippets.

@2015kino
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2015kino/966fb8b0ea49e1d42eda to your computer and use it in GitHub Desktop.
Save 2015kino/966fb8b0ea49e1d42eda to your computer and use it in GitHub Desktop.
201506Q1003
data work1001;
p=cdf('normal',25,20,5); /*正規分布の累積分布関数->CDF*/
z=1-p; /*問では超える確率としているので、正規分布の右側の面積の数値を求める*/
n=7;
d0=comb(n,0)*z**0*(1-z)**(n-0); /*0日の確率*/
d1=comb(n,1)*z**1*(1-z)**(n-1); /*1日の確率*/
d2=comb(n,2)*z**2*(1-z)**(n-2); /*2日の確率*/
d3=comb(n,3)*z**3*(1-z)**(n-3); /*3日の確率*/
d4=comb(n,4)*z**4*(1-z)**(n-4); /*4日の確率*/
d5=comb(n,5)*z**5*(1-z)**(n-5); /*5日の確率*/
d6=comb(n,6)*z**6*(1-z)**(n-6); /*6日の確率*/
d7=comb(n,7)*z**7*(1-z)**(n-7); /*7日の確率*/
d8=d6+d7+d5+d4+d3+d2; /*2日以上の確率*/
d9=1-d0-d1; /*2日以上の確率*/
run;
proc print data=work1001;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment