statasur

statasur - Stata survival commands for Moore/McCabe...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Stata survival commands for Moore/McCabe Assignments. See ‘findit’ to search for and download user-written commands; ‘encode x, gen(newx)’ to destring a variable that should be quantitative or ‘destring x, gen(newx)’ for easier use of a string (i.e. text) variable; ‘input’ to create a small data set; ‘gen id=_n’ to create an id variable; ‘robmean’ to obtain a trimmed mean; ‘centile’ to form deciles; gen z=uniform(), n(…) to create a data set of specified n with standard norm distribution; ‘lincom’ to obtain predicted values of y (yhat) after a regression equation; and ‘egen std()’ to create a standardized variable. To save a work session’s commands (without creating a command file or log file): right-click the Review window, then click either ‘Save All’ or ‘Save Selected.’ To use the Command window’s calculator: display 1+1 [enter] di (2+5)/(1+1) [enter] Chapter 1 use ex01_017.dta, clear describe su glucose, detail stem glucose stem glucose, prune use ta01_007.dta, clear desc su pasadena reading, d [d: abbreviates ‘detail’] hist pasadena, norm gr bar pasadena, norm hist reading, norm gr bar reading, norm twoway line pasadena reading year twoway line pasadena reading year, ylabel(0(25)100) xlabel(1950(25)2000) use ex01_029.dta, clear d [d: abbreviates ‘describe’] stem dtscore dotplot dtscore histogram dtscore, norm kdensity dtscore, norm gr box dtscore qnorm dtscore
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 use ta01_009.dta, clear d tab gender su concept, d stem concept bys gender: su concept bys gender: stem concept use ta01_005.dta, clear d su damage, d hist damage, norm gr box damage use ex01_060.dta, clear d su trees, d hist trees, norm gr box trees bys group: su trees, d hist trees, by(group) norm gr box trees, over(group) u ta01_008.dta, clear d su days, d hist days, norm gr bar days help centile centile days, centile(20 40 60 80) u ta01_008.dta, clear d su days, d hist days, norm gr bar days help robmean [‘robust mean’] robmean days, trim(.1)
Background image of page 2
3 ex01_035.dta, clear d su study, d tab sex stem study stem study if study<300 bys sex: su study, d bys sex: stem study bys sex: stem study if study<300 di (25000+60000+255000)/3 display norm(1.85) di invnorm(.96784) [di: abbreviates ‘display’] Chapter 2 use ta01_010.dta, clear d [‘type’ is coded as a string (text) variable] tab type tab type if type==”M” destring type, gen(typeq) [By destringing type, you don’t have to use “…”] tab1 type typeq, nolabel [or: codebook type typeq] Ex 2.29 input x 66 64 66 65 70 65 End [Repeat using y data] hist x, norm hist y, norm su x y, d scatter y x || qfit y x corr x y Note: If the text-coded variable should be treated as quantitative, then instead of ‘destring’ use ‘encode varname, gen(newx)’.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Ex 2.53 su rate mass, d bys sex: su rate mass, d hist rate, by(sex, total) norm hist mass, by(sex, total) norm gr box rate, over(sex, total) gr box mass, over(sex, total)
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

statasur - Stata survival commands for Moore/McCabe...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online