survival

survival - Stata Survival Commands for Moore/McCabe/Craig...

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

View Full Document Right Arrow Icon
1 Stata Survival Commands for Moore/McCabe/Craig § 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, e.g.: display 5 - 1 [press ‘enter’] di 6*2 [press ‘enter’] di (2+5)/(1+1) [press ‘enter’] § To inspect the spreadsheet: browse [type this in Command window, press ‘enter’] § findit placevar [type in the Command window and press ‘enter’]: click the blue-link to download, e.g., the user-created command placevar. § To make a data folder from within Stata: mkdir c:\hwdata [type this in Command window, press ‘enter’] § To change to the data folder from within Stata: cd: c:\hwdata [type this in Command window, press ‘enter’] § missing observations = . Stata treats ‘.’ as the highest value, so, e.g.: su x if x>65 & x<. (so that Stata doesn’t include ‘.’ in the results). Ex. 1.5 help input [type in Command window, press ‘enter’] input exam [type in Command window, press ‘enter’] 80 [press ‘enter’] 73 [press ‘enter’] [continue entering all scores] . . end [press ‘enter’] Note: If an error message displays after you type ‘enter’, re-do the procedure by clicking its steps in the Review window, making sure there’s an observation number on the left-hand side in the Results window before you type ‘enter’. help list help stem list exam list exam in 1/4 [1/4: first to fourth observations] list exam in 5/l [5/l: fifth to last observations] list exam if exam==45 list exam if exam < 45 list exam if exam <=45 list exam if exam > 45 & exam <. [<.: exclude missing observations] list exam if exam >= 45 & exam <. list exam if exam ~=45 [or: !=45] list exam if exam==. [list missing observations for exam]
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 sort exam [sort: lowest to highest values] list exam gsort –exam [sort: highest to lowest values] list exam browse [to inspect spreadsheet] edit [to edit spreadsheet: but this way is not recommended] summarize exam if exam==45 su exam if exam < 60 [abbreviated summarize: su] su exam if exam <= 60 su exam if exam >60 & exam<. su exam if exam >=69 & exam<. su exam if exam==65 su exam if exam ~= 65 [or: !=65] stem exam stem exam if exam < 70 stem exam if exam >= 45 & exam <. Ex 1.19 use ex01_019, clear [type in Command window. Abbreviated: u] help describe d [describe: abbreviated] l spam percent [list: abbreviated] help graph gr bar percent, over(spam, sort(1)) [graph: abbreviated] gr save ex1_19, replace Right-click graph: Copy graph > paste to Word document Try hands-on graph formatting gr bar percent, over(spam) Right-click the graph > Start Graph Editor > right-click in bar region > Bar Region Properties: Sort bars > OK Right-click graph: Save graph > ex1_19, replace Right-click graph: Copy graph > paste to Word document Helpful alternative for some kinds of bar graph: findit catplot [then click blue link to download catplot]
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

survival - Stata Survival Commands for Moore/McCabe/Craig...

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

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