Statalist The Stata Listserver


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

st: ttest subsample help


From   "michael macciomei" <[email protected]>
To   <[email protected]>
Subject   st: ttest subsample help
Date   Thu, 19 Apr 2007 08:30:11 -0400

hello everyone I am new to stata and I am stuck.
I am trying to do a simple ttest to see if my means differ significantly.  However I have 12 variables that each can be broken down into 4 subcategories (ex. Netincome could be classified as NIsamestate, NIdiffstate, NIsamesector, NIdiffsector)
I want to compare those 4 against each other and do the same for all 12 variables.  So far I have done this:

foreach var of varlist ni-roe{
gen new`var'=`var' if targetstate==acquirorstate
}

I did this same command 4 times creating 48 variables.
Now I want to run a ttest but I have no clue. And was there a simpler way I could have done the above command?  Can anyone help?

Sincerely,
Michael  
               
*
*   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