cap log close log using stata-read_data-input.smcl, replace smcl /* READING DATA: Using Input */ /* Problem #2: Use the input command to create a Stata data set. Note that the storage type is declared in the input statement. So, Using compress has no effect--the data are stored as efficiently as possible. */ clear input str23 party byte (up elected notup y2004 y2006 plusminus) vote percent data "Democratic Party" 17 22 27 44 49 5 33929202 53.91 "Republican Party" 15 9 40 55 49 -6 26674169 42.38 "Independents" 1 2 0 1 2 1 879032 1.40 "Libertarian Party" 0 0 0 0 0 0 614629 0.98 "Green Party" 0 0 0 0 0 0 414660 0.66 "Constitution Party" 0 0 0 0 0 0 132155 0.21 "Peace and Freedom Party" 0 0 0 0 0 0 117764 0.19 "Write-in" 0 0 0 0 0 0 13567 0.02 "Socialist Workers Party" 0 0 0 0 0 0 10463 0.02 "Personal Choice Party" 0 0 0 0 0 0 9089 0.01 "Socialist Party USA" 0 0 0 0 0 0 2490 0.00 "Others" 0 0 0 0 0 0 141074 0.22 end /* Problem #3: Format the variable display */ format party %-23s format vote %10.0fc format percent %9.2f /* Problem #4: No work. See the note for #1 */ /* Problem #5: describe and list the data */ describe list log close