![]() ![]() The tab1Ĭommand is a convenience command to produce multiple one-way frequency tables. The tab (short for tabulate) command can produce one-way or two-way frequency tables. G) Create frequency tables of categorical variables using tabulate Graph box write, over(prgtype) /* box plots by prgtype */ Histogram math, normal by(prgtype) /* densities by prgtype */ The histogram and boxplot graphed above can both be produced separately by group, using the by option or the over option, depending on the command. Tabstat write, by(prgtype) stat(n mean sd p25 p50 p75) Tabstat read write math, by(prgtype) stat(n mean sd) The tabstat command can calculate descriptive statistics within groups. Kdensity write, normal width(5) /* a smoother kdensity plot */į) Exploring continous variables by group Histogram write, normal start(30) width(5) /* wider bins for a smoother plot */ Histograms, density plots and boxplots, created by histogram, kdensity and graph box respectively, illustrate the distribution of variables. Sum write if read >=60 /* sum is abbreviation of summarize */Į) Graphs for exploring continuous variables Summarize read math science write /* summarize just these variables */ĭisplay 9.48^2 /* variance is the sd (9.48) squared */ More statistics are available with the detail option. The basic descriptive statistics command in Stata is summarize, which calculates means, standard deviations, and ranges. ![]() The labelbook command describes all value labels used in the data.ĭ) Calculate descriptive statistics of continuous variables with summarize Here we also use lookfor to find all variable names or variable labels that contain an “s”. The describe command gives information about how the variable is stored in Stata, while the codebook provides diverse information, including the type of variable, range, frequent values, amount of missing, etc. You can supply variable names and observation numbers to both list and browse to restrict the display to a subset of the data.Ĭ) Use describe and codebook to characterize your variables, and labelbook to characterize your data labels The command list prints your data to the screen, while browse opens the data editor. That the log can be read in any text editor, such as NotePad or WordPad.ī) Use list and browse to display your data Next, we will open a log file which will save all of the commands and the output We will begin by loading hs0.dta, with the use command. In this section, we will demonstrate commands that allow you to get quick looks at your data for exploring. Histogram for continuous and categorical variables
0 Comments
Leave a Reply. |