-------------------------------------------------------------------------------
help for effcon
-------------------------------------------------------------------------------

Confidence limits for effect size estimated from one or two samples from normal > distribution

effcon [depvars] [if exp] [in range] ,[ group(string) confdir(string) level(real) {xb1(real) s(real) n1(real)]} {[xb2(real) {n2(real)]}

Description

effcon estimates lower and upper condifence limits for the effect size estimated with a) one sample from a normal distribution or b) two independent samples from normal distributions with the same variance.

In Case a), the data is assumed to come from a N(mu,sigma^2) distribution Here, the effect size is defined as mu/sigma.

In Case b), there are two sets of data coming from N(mu1,sigma^2) and N(mu2,sigma2) distributions. Here, the effect size is defined as (mu1 - mu1)/sigma

Usage This program calculates 1-sided confidence limits at level 1-alpha, where typically alpha is a small number, say alpha = 0.05. The user may either specify a variable from which to estimate the effect size ("standard" mode), or may interactively provide estimated values of the mean(s) and (common) standard deviation along with sample sizes(s) ("interactive" mode).

A typical application of effcon is to faciliate conservative power calculations for 1 and 2-sample t-tests. For these tests, the power is a function of the test level, effect size E and a proposed sample size. Rather than use a point estimate of E, perhaps obtained from a small amount of pilot data, it is prudent to calculate power using a lower confidence limit for E instead.

Options

group() A string containing the name of a two-category variable defining the groups for the 2-sample case in standard mode. Omit this option in the 1-sample case. In the interactive mode, this option is ignored.

confdir() allows the user to specify whether the confidence limit is a lower or an upper one. Any string beginning with the letter "U" (regardless of case) will be interpreted as a request for an upper limit; any string beginning with the letter "L" (regardless of case) will be interpreted as a request for a lower limit. Default option is "lower".

level() the 1-sided confidence level (e.g. 0.95). Default level is 0.95. The level may either be expressed as a decimal fraction (eg. 0.90) or as a percent (e.g. 90). If the input value is greater than or equal to 1.0, it will be assumed that the percent mode is intended. If the input value is less than 1, it will be assumed that the decimal fracion mode is intended.

The following are required in interactive mode:

Case a) - one sample:

xb1() estimated mean

n1() sample size

s() estimated standard deviation

Case a) - two samples:

xb1() and n1() as above for the first sample

xb2() estimated mean for second sample

n2() size of second sample

s() pooled estimate of common standard deviation

Examples

. effcon x

. effcon x,confdir(upper) level(.90)

. effcon x,confdir(upper) level(.90) group(gender)

. effcon ,xb1(2.345) n1(15) s(0.874)

. effcon ,confdir(U) level(90) xb1(2.345) n1(15) xb2(1.123) n2(20) s(1.022)

Saved results

The following quantities (if appropriate) are saved:

scalars: r(n1) = n1

r(n2) = n2

r(xb1) = xb1

r(xb2) = xb2

r(s) = s

r(R) = 1/(1/n1 + 1/n2)

r(Z0) = point estimate of effect size

r(Zp) = lower (upper) confidence limit for effect size

r(level) = confidence level

Method 1-sample case. Let xb and s be estimates of mu and sigma from n observations from a N(mu, sig^2) distribution. Then it can be shown that xb/s is distributed as sqrt(n) times a non-central t distribution with n-1 d.f. and non-centrality parameter la = mu*sqrt(n)/sig. In other words

P{xb/s < (1/sqrt(n))*t'(1-alpha,n-1,la) } = 1-alpha > (1)

where t'(p,df,la) denotes the 100*p-th percentage point of the non-central t-distribution with df degrees of freedom and non-centrality parameter la.

It also can be shown that as a function of la, G(la) = t'(1-alpha,n-1,la) is strictly increasing over the whole real line, so that its inverse G-1(t) always exists. multiplying by sqrt(n) and taking G-1 of both sides in (1), gives

P{G-1(xb*sqrt(n)/s) < la } = 1-alpha

=> P{G-1(xb*sqrt(n)/s) < mu*sqrt(n)/sig } = 1-alpha >

=> P{mu/sig > (1/sqrt(n))*G-1(xb*sqrt(n)/s) } = 1-alpha >

In other words, (1/sqt(n))*G-1(xb*sqrt(n)/s) is a 100(1-alpha)% lower confidence limit for mu/sig.

To obtain the upper limit, start with a lower confidence limit of level alpha (not 1 - alpha). Then

=> P{mu/sig > (1/sqt(n))*H-1(xb*sqrt(n)/s) } = alpha > (2)

where H(la) = t'(alpha,n-1,la). Then taking the complentary event in (2), one obtains

=> P{mu/sig < (1/sqt(n))*H-1(xb*sqrt(n)/s) } = 1-alpha >

In other words, (1/sqt(n))*H-1(xb*sqrt(n)/s) is a 100(1-alpha)% upper confidence limit for mu/sig.

2-sample case. Let xb1, xb2 be estimates of mu1, mu2 and let s be the pooled estimate of a common standard deviation sigma from respective samples of n1 and n2 observations of N(mu1,sigma^2) and N(mu2,sigma^2). Then in a similar fashion to the single-sample case, it can be shown that (xb1-xb2)/s is distributed as sqrt(ñ) times a non-central t distribution with n1 + n2 - 2 d.f. and non-centrality parameter la = (mu1-mu2)*sqrt(ñ)/sig, where

ñ = 1/(1/n1 + 1/n2)

Using the same logic as for the 1-sample case, it then follows that a 100(1-alpha)% lower confidence limit for (mu1 - mu2)/sig is

(1/sqt(ñ))*G-1((xb1-xb2)*sqrt(ñ)/s),

and that the corresponding upper confidence limit is

(1/sqt(ñ))*H-1((xb1-xb2)*sqrt(ñ)/s).

This program uses nctncp and ridder to calculate G-1 and H-1. nctncp is one of the programs in the non-central t utility package, written by Tom Steichen (ssc describe nct). ridder is a function solver utility, written by Tim McGuire, that may be obtained from STB-24 (findit ridder).

Limitations Numerical problems may arise if xb*sqrt(n)/s or (xb1-xb2)*sqrt(ñ)/s is too large in absolute value, depending upon alpha and the degrees of freedom.

Author

Alan H. Feiveson, NASA Johnson Space Center alan.h.feiveson@nasa.gov

References

Owen, D. B. (1968), "A Survey of Properties and Applications of the Non-central t-Distribution," {it;Technometrics},10, 445-478.

Lawless, J. F. (2002) Statistical Methods and Methods for Lifetime Data (2nd ed.). New York:John Wiley.

Chakraborti,S. and Li, J. (2007). "Confidence Interval Estimation of a Normal Percentile", American Statistician vol. 61, No. 4, pp. 331-336.

Also see

Online: help for nct (if installed), help for ridder (if installed)