Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loop to change MDE and N in pcpanel command

    Hi. I'm using the pc_simulate command to find a sample size that will give me a power of 80%. I want to vary the MDE of the following code to get sample sizes with a power of 80% for MDE 0.1, 0.15, and 0.2. Is there anyway for me to write a loop that will vary the MDE and the N in the following code telling the code to spit out a result when the power=0.8 for each of the MDE? I'd greatly appreciate any help here.

    Code:
    pc_simulate tot_con, model(ANCOVA) mde(0.15) i(performer_id) t(week_num) n(800) bootstrap p(0.5) pre(4) post(16) alpha(0.05) nsim(1000) vce(robust) outfile(provider_week_power.csv) append

  • #2
    The results come out in the format below, so what the code would ideally do is something like: foreach MDE of 0.1, 0.15 and 0.2, while power <0.8, add/gen n+100. I've tried multiple ways, but have been unsuccessful so far.


    Code:
    Completed:   n=800   p=.5   mde=.15   pre=4   post=16   power= 0.629

    Comment


    • #3
      Anyone on this? I am also interested

      Comment

      Working...
      X