Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: generate graph

From   "Philip Ryan" <>
To   <>
Subject   st: RE: generate graph
Date   Thu, 3 Nov 2011 18:04:13 +1030


Something like this (grafting onto -sampsi-) ?:

*==== begin code ====*

tempname temp_ss
local sd .75
local pow 0.8
local m1 0.35
local m2 0

quietly {
postfile `temp_ss'  sample_size  alpha  using  my_ss, replace

forvalues alpha = .01(.01).2{
sampsi `m1'  `m2', alpha(`alpha')  power(`pow') sd(`sd')  r(1)
post `temp_ss' (r(N_1)) (`alpha')

postclose `temp_ss'


/* now make use of our new data set */

use my_ss
list, clean abbrev(16)
graph twoway line  sample_size alpha,  ///
 ytitle("sample size in each group") xlabel(0(.01).2) ///
 lwidth(medthick) lcolor(blue)

*=== end code ===

Philip Ryan

-----Original Message-----
[] On Behalf Of Nikolaos Pandis
Sent: Thursday, 3 November 2011 5:34 PM
Subject: st: generate graph

Hi to all.
I was wondering if someone could help me generate the following graph:
twoway line graph showing on the y-axis: sample size and on the x-axis:
The objective is to show how the p-value decreases (increases) as the sample
size increases (decreases) given the same effect size and sd
Many thanks,

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index