From: Brian Sauer on
I would like to generate longitudinally correlated data that follows
an AR(1) correlation structure. If anyone in the group has code for
generating AR(1) corrected binary data and is willing to share it will
be greatly appreciated.
Brian
From: shiling99 on
On Apr 25, 2:53 pm, Brian Sauer <brian.sa...(a)gmail.com> wrote:
> I would like to generate longitudinally correlated data that follows
> an AR(1) correlation structure. If anyone in the group has code for
> generating AR(1) corrected binary data and is willing to share it will
> be greatly appreciated.
> Brian

Here is a simulation program with error structure of AR(1) and
response (y) is binary.


data t1;
seed=99876;
e=rannor(seed);
do t=-50 to 2500;
e1=0.8*e +rannor(seed);
x=rannor(seed);
ystar=1+1*x + e1;
y=ystar>0;
if t >0 then output;
e=e1;
end;
run;
From: Ryan on
On May 16, 4:34 pm, shilin...(a)yahoo.com wrote:
> On Apr 25, 2:53 pm, Brian Sauer <brian.sa...(a)gmail.com> wrote:
>
> > I would like to generate longitudinally correlated data that follows
> > anAR(1) correlation structure.  If anyone in the group has code for
> > generatingAR(1) corrected binary data and is willing to share it will
> > be greatly appreciated.
> > Brian
>
> Here is a simulation program with error structure ofAR(1) and
> response (y) is binary.
>
> data t1;
>    seed=99876;
>    e=rannor(seed);
>    do t=-50 to 2500;
>       e1=0.8*e +rannor(seed);
>           x=rannor(seed);
>           ystar=1+1*x + e1;
>           y=ystar>0;
>           if t >0 then output;
>           e=e1;
>    end;
> run;

How would the code above be modified to allow for correlations within
groups of observations based on a first-order autocorrelation
structure (e.g. each of the 100 "subjects" are measured at four
equally distanced time points)? Thanks.
From: Ryan on
On May 21, 7:13 am, Ryan <ryan.andrew.bl...(a)gmail.com> wrote:
> On May 16, 4:34 pm, shilin...(a)yahoo.com wrote:
>
>
>
>
>
> > On Apr 25, 2:53 pm, Brian Sauer <brian.sa...(a)gmail.com> wrote:
>
> > > I would like to generate longitudinally correlated data that follows
> > > anAR(1) correlation structure.  If anyone in the group has code for
> > > generatingAR(1) corrected binary data and is willing to share it will
> > > be greatly appreciated.
> > > Brian
>
> > Here is a simulation program with error structure ofAR(1) and
> > response (y) is binary.
>
> > data t1;
> >    seed=99876;
> >    e=rannor(seed);
> >    do t=-50 to 2500;
> >       e1=0.8*e +rannor(seed);
> >           x=rannor(seed);
> >           ystar=1+1*x + e1;
> >           y=ystar>0;
> >           if t >0 then output;
> >           e=e1;
> >    end;
> > run;
>
> How would the code above be modified to allow for correlations within
> groups of observations based on a first-order autocorrelation
> structure (e.g. each of the 100 "subjects" are measured at four
> equally distanced time points)? Thanks.- Hide quoted text -
>
> - Show quoted text -

Correction--replace autocorrelation with autoregressive. Any tips
would be appreciated.