Statalist


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

st: RE: Creating Datasets with Parmby


From   "Newson, Roger B" <[email protected]>
To   <[email protected]>
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


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
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected] 
Web page: www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/pop
genetics/reph/

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

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Claude
Francoeur
Sent: 08 March 2008 20:26
To: [email protected]
Subject: st: Creating Datasets with Parmby

Hello,

I want to ultimately export my results to Excel. For this, I understand
that 
I should create datasets and that parmby does just that. I was not able
to 
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.

Claude


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:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   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