K****a 发帖数: 67 | 1 请版上好心人帮帮我一下,感激不尽
需要用SAS Monte Carlo simulation,模拟一组实验数据 group randomization trial:
要求outcomes within a group are correlated and binary(0/1),given
correlation coefficient as rho=0.01.
predictor variables 有categorical (e.g. treatment, gender ....)和continous
类型。
我搜了许多文献,许多写道要用beta-binomial distribution 来生成数据,可是依然
没有弄明白怎么写code,把这个outcome的相关系数rho插进去,或者我怎么确定相关度
是我想要的呢?
谢谢各位
这是网上一个例子:
data test;
>> b0 = -1.3;
>> b1 = 2.2;
>> b2 = 0;
>> s = 0.6;
>> do group=1 to 30;
>> gamma = s*rannor(123... 阅读全帖 |
|
D******n 发帖数: 2836 | 2 create a .vim directory under you home directory(there is a dot before
vim)
and then create a syntax directory under it
and then create a sas.vim file under the syntax directory
==============sas.vim======================
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
syn case ignore
syn region sasString start=+"+ skip=+\\|\"+ end=+"+
syn region sasString start=+'+ skip=+\\|\"+ end=+'+
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
sy... 阅读全帖 |
|
k*******a 发帖数: 772 | 3 是啊,的确是这个问题,我用SAS做了下,比较容易correct这个问题,赌注为0.75和手
上有的钱的最小值
%let sp = 15;
%let nrep = 3000;
data a;
do i = 1 to &nrep;
total = 5;
do while (total > 0 and total < &sp);
total = total + (ranbin(123, 1, .495)-0.5)*2*min(.75, total);
end;
gain = max(0, total - 5);
output;
end;
run;
proc means data = a;
var gain;
run; |
|