UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

What's New in Stata 9: Other Features

Non-statistical new features

There are many new features of Stata 9, among them we will mention a few here:

*exploring command mean
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
mean write read math
mean write math, cluster(ses)
mean write, over(female)
test [write]female = [write]male
*exploring command ratio
webuse fuel, clear
list
ratio mpg1 / mpg2 
ratio myratio: mpg1/mpg2 /*naming issue*/
test _b[myratio] = 1
*exploring command proportion
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
proportion ses

*exploring command total

total write
total write, over(ses)
gen hiwrite = write > 60
total hiwrite
total hiwrite, over(female)
*exploring slogit, mprobit and asmprobit

slogit ses female write
slogit ses female write, dim(2) 
mlogit ses female write, basecat(3) /*same as slogit above*/
mprobit ses female write
* asmprobit (Maximum simulated-likelihood alternative-specific multinomial probit models)
webuse travel
clist in 1/10
asmprobit choice traveltime termtime, casevars(income) case(id) alternatives(mode)
*exploring multiple graphics windows
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
graph twoway scatter write math
graph twoway scatter write math, name(g1)
histogram write, name(g2)
*new feature of merge
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
foreach var of varlist write math read science socst {
     preserve
     keep id `var'
     sort id
     save `var', replace
     restore
}
use read, clear
drop if _n<=10
save, replace
use write
merge id using math read science socst
tablist _merge*
clear
use read, clear /*nonsymmetric bahavior of _merge*/
merge id using write math science socst
tablist _merge*
*xml stuff, IT IS COOL!!!!
use http://www.ats.ucla.edu/stat/stata/notes/hsb2, clear
xmlsave hsb2, doc(excel) replace
/*hsb2.xml can be opened by excel directly*/
/*file saved as .xml file in Excel can be read into Stata directly 
  using xmluse*/
xmluse hsb2, doc(excel) first 
xmlsave hsb2_dta, doc(dta) dtd
*other other stuff
viewsource qreg.ado
copysource qreg.ado

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California