SAS Code Fragments
Saving a Correlation Matrix as a Data File

data test;
  do time = 1 to 10;
    do mom = 1 to 50;
          x3 = rannor(123);
          do kid = 1 to 3;
            y = rannor(345);
                x1 = rannor(3221);
                x2 = rannor(999);
                output;
          end;
    end;
  end;
run;


proc means data=test;
run;


proc mixed data=test;
  class mom kid time;
  model y = x1 x2 x3 / solution ;
  repeated time / subject = mom(kid) type=ar(1) ;
run;

How to cite this page

Report an error on this page or leave a comment

The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.