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

Info icon This preview shows pages 1–4. 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]
Image of page 1

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

View Full Document Right 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] Ex 1.20 u ex01_020, clear d l gr bar female, over(degree) 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
Image of page 2
3 Ex 1.20
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern