[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Creating Datasets with Parmby

From   "Newson, Roger B" <>
To   <>
Subject   st: RE: Creating Datasets with Parmby
Date   Sun, 9 Mar 2008 15:39:37 -0000

The reason that -parmby- doesn't work with -ttest- is that -ttest- is
not an estimation command. To output confidence intervals for t-tests
using -parmby-, you must use the -regress- command. As in:

parmby "regress cctanormal familydummy", by(modeofpayment)
saving(myresults, replace)

which will create an output dataset (or resultsset) in the file
-myresults.dta-, with 1 observation per parameter per value of
-modeofpayment-. If -familydummy- is a binary variable with values 0 and
1, then the parameter named -_cons- will be the mean for observations
for which -familydummy- is zero, and the parameter named -familydummy-
will be the mean difference between observations where -familydummy- is
1 and observations where -familydummy- is zero.

Alternatively, you can parameterize the model differently, using -xi-.
If you type

parmby "xi, noomit: regress cctanormal i.familydummy, noconst",
by(modeofpayment) label saving(myresults.txt)

then the resultsset will have 1 obsrvation per parameter per value of
-modeofpayment-, and the parameters will be the means of the 2 subroups
defined by -familydummy-. The -metaparm- command (which is part of the
-parmest- package) can be used to create a new resultsset, containing
estimates and confidence intervals for differences between these means.

I hope this helps.

Best wishes


Roger B Newson
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Web page:
Departmental Web page:

Opinions expressed are those of the author, not of the institution.

-----Original Message-----
[] On Behalf Of Claude
Sent: 08 March 2008 20:26
Subject: st: Creating Datasets with Parmby


I want to ultimately export my results to Excel. For this, I understand
I should create datasets and that parmby does just that. I was not able
include the parmby command in the following commands correctly. Could 
anybody show me how to modify the following commands to incorporate the 
parmby command?

Thank you very much.


by modeofpayment2, sort : ttest cctanormal, by(familydummy)

by modeofpayment2 familydummy, sort : tabstat cctanormal cctkanormal, 
statistics( mean sd sem count ) columns(variables)

by modeofpayment2 familydummy, sort : ttest cctanormal == 0

*   For searches and help try:

*   For searches and help try:

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