Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: dialog box programming


From   Friederike Barthel <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: dialog box programming
Date   Wed, 16 Jul 2003 10:16:21 +0100

Dear List

I have written a dialog box program to operate an ado file with the syntax:

program define sampinter, rclass

version 7.0

syntax, Alpha (numlist>0) Power (numlist>0) Delta (numlist >0) [Tau (numlist
>0)] Pcontrol (numlist >=0 <=1) [ Q1(numlist >=0 <=1)] t1(numlist > 0)
t2(numlist > 0) [a1(numlist >0 )] [u(numlist > 0)]



However, when i operate the dialog box, the box itself works, but on feeding
the information into the sampinter program, it issues the following error:

. sampinter, alpha(`main.ed_alpha') power(`main.ed_power')
delta(`main.ed_delta
> ') pcontrol(`main.ed_pcontrol') t1(`main.ed_t1') t2(`main.ed_t2')
a1(`main.ed
> _a1')

option alpha() required
r(198);


Does anyone know a solution to the problem?

Thank you

Sophie 


dialog box program:

/*
basicdlg

VERSION 1.0 SB 04Jun2003.

Sample Size: With interaction

keyword: rclass

*/

VERSION 8.0

POSITION . . 490 370

DIALOG main, title("Basic sample size calculation") 
BEGIN
	TEXT tx_alpha 10  10 30 . , label("Alpha (2-sided)")
	EDIT ed_alpha    +20 @  @  . , label("alpha") default(0.05)

	TEXT tx_power 40  10 30 . , label("Power")
	EDIT ed_power    +20 @  @  . , label("power") default(0.8)

	TEXT tx_hratio 10  30 30 . , label("Hazard ratio")
	EDIT ed_delta    +20 @  @  . , label("hratio")

	TEXT tx_pcontrol 40  30 30 . , label("Allocation")
	EDIT ed_pcontrol    +20 @  @  . , label("allocation") default(0.5)

	TEXT tx_t1 10  50 30 . , label("Accrual period")
	EDIT ed_t1    +20 @  @  . , label("accrual")

	TEXT tx_t2 40  50 30 . , label("Follow-up period")
	EDIT ed_t2    +20 @  @  . , label("follow")

	TEXT tx_a1 10  70 30 . , label("Median Survival")
	EDIT ed_a1    +20 @  @  . , label("a")
END

OK     ok1, label("OK")
CANCEL can1, label("Cancel")
HELP   hlp1, label("Help") view("help Sample Size")
RESET  res1

PROGRAM command
BEGIN

	if !(main.ed_delta) {
		stopbox stop "You must specify a hazard ratio!"
	}

	if !(main.ed_t1) {
		stopbox stop "You must specify the length of accrual
period!"
	}

	if !(main.ed_t2) {
		stopbox stop "You must specify the length of follow up
period!"
	}

	if !(main.ed_a1) {
		stopbox stop "You must specify the median survival!"
	}

	put "sampinter"

	put ", "

	put "alpha(`main.ed_alpha') "

	put "power(`main.ed_power') "

	put "delta(`main.ed_delta') "

	put "pcontrol(`main.ed_pcontrol') "

	put "t1(`main.ed_t1') "

	put "t2(`main.ed_t2') "

	put "a1(`main.ed_a1') "

END

	


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index