Programming the statistical procedures from SAS

Problems with code (in the do loop?) for proc logistic MC exact estimate

Reply
New Contributor
Posts: 2

Problems with code (in the do loop?) for proc logistic MC exact estimate

I am trying to run a logistic regression using a hybrid MC exact estimation technique. There appears to be something wrong with my code and I think it is in the do loop. I am brand new to the SAS language and someone provided me with the following sloppy code.

I was trying to run the analysis in SAS Enterprise Guide with SAS version 9.3. Apparently this code worked in a previous or later version of SAS. Any obvious mistakes with the code? The data is a binary response of two different count techniques with the actual paired counts as predictors.

Sincerely, Gifford Gillette

data Data1;

    do ID=1 to 16;

      do Outcome = 1 to 0 by -1;

        input rnam Count @@;

        output;

      end;

    end;

    datalines;

1 20 0 13

1 12 0 19

1 14 0 58

1 0 0 5

1 12 0 12

1 12 0 2

1 0 0 0

1 12 0 12

1 16 0 10

1 23 0 19

1 30 0 12

1 12 0 9

1 16 0 16

1 31 0 5

1 10 0 13

1 18 0 17

;

  proc logistic data=Data1 exactonly exactoptions (Method=NetworkMC) plots=all;

      strata ID;

      model rnam=count;

      exact count / estimate=both;

  run;

Respected Advisor
Posts: 4,606

Re: Problems with code (in the do loop?) for proc logistic MC exact estimate

Works fine in SAS/STAT 12.1 (SAS 9.3 TS1M2). - PG

PG
New Contributor
Posts: 2

Re: Problems with code (in the do loop?) for proc logistic MC exact estimate

PGStats,

Hmmm.....

Any chance you could run this similar code and email me the results? I have a feeling our University SAS version needs updated.

data Data1;

     do ID=1 to 12;

       do Outcome = 1 to 0 by -1;

         input rnam Count @@;

         output;

       end;

     end;

     datalines;

1 17 0 17

1 11 0 9

1 13 0 8

1 7 0 2

1 18 0 9

1 19 0 13

1 22 0 13

1 20 0 16

1 2 0 0

1 28 0 19

1 40 0 29

1 4 0 2

;

   proc logistic data=Data1 exactonly exactoptions (Method=NetworkMC) plots=all;

      strata ID;

      model rnam=count;

      exact count / estimate=both;

   run;

gillgiff@isu.edu

Super User
Super User
Posts: 6,137

Re: Problems with code (in the do loop?) for proc logistic MC exact estimate

I don't see anything wrong with the data step code, but I did notice that OUTCOME and RNAM always have the same value.

Ask a Question
Discussion stats
  • 3 replies
  • 179 views
  • 0 likes
  • 3 in conversation