Programming the statistical procedures from SAS

how can I create a data with 10 zeros and 20 ones?

Reply
N/A
Posts: 1

how can I create a data with 10 zeros and 20 ones?

so that the frequency of zero is 10, and that of one is 20. thanks

Trusted Advisor
Posts: 1,137

Re: how can I create a data with 10 zeros and 20 ones?

hi,

please check the below code;

data want(drop=i);

    do i=1 to 10;

    number=0;

    output;

    end;

    do i=1 to 20;

    number=1;

    output;

    end;

run;

proc freq data=want;

    table number;

run;

Thanks,

Jag

Thanks,
Jag
Ask a Question
Discussion stats
  • 1 reply
  • 124 views
  • 0 likes
  • 2 in conversation