Example: bachelor of science

Syntax - Stata

Flexible table of summary statisticsSyntaxMenuDescriptionOptionsRe marks and examplesMethods and formulasAlso seeSyntaxtablerowvar[colvar[supercolvar] ][if][in][weight][,options]optionsDescri ptionMaincontents(clist)contents of table cells; select up to five statistics; default iscontents(freq)by(superrowvarlist)super row variablesOptionscellwidth(#)cell widthcsepwidth(#)column-separation widthstubwidth(#)stub widthscsepwidth(#)supercolumn-separation widthcentercenter-align table cells; default is right-alignleftleft-align table cells; default is right-aligncwperform casewise deletionrowadd row totalscolumnadd column totalsscolumnadd supercolumn totalsconcisesuppress rows with all missing entriesmissingshow missing statistics with periodreplacereplace current data with

table— Flexible table of summary statistics 5 We abbreviated contents() as c(). The format() option will allow us to better format the numbers

Tags:

  Content, Table, Syntax

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Syntax - Stata

1 Flexible table of summary statisticsSyntaxMenuDescriptionOptionsRe marks and examplesMethods and formulasAlso seeSyntaxtablerowvar[colvar[supercolvar] ][if][in][weight][,options]optionsDescri ptionMaincontents(clist)contents of table cells; select up to five statistics; default iscontents(freq)by(superrowvarlist)super row variablesOptionscellwidth(#)cell widthcsepwidth(#)column-separation widthstubwidth(#)stub widthscsepwidth(#)supercolumn-separation widthcentercenter-align table cells; default is right-alignleftleft-align table cells; default is right-aligncwperform casewise deletionrowadd row totalscolumnadd column totalsscolumnadd supercolumn totalsconcisesuppress rows with all missing entriesmissingshow missing statistics with periodreplacereplace current data with table statisticsname(string)name new variables with prefixstringformat(%fmt)display format for numbers in cells; default isformat(% )byis allowed; see [D] ,iweights, andpweights are allowed.

2 See[U] may not be used withsd,semean,sebinomial, may not be used withsemean,sebinomial, the elements ofclistmay befreqfrequencynvarnamesame ascountmeanvarnamemean ofvarnamemaxvarnamemaximumsdvarnamestand ard deviationminvarnameminimumsemeanvarnames tandard error of the meanmedianvarnamemedian(sd/sqrt(n))p1var name1st percentilesebinomialvarnamestandard error of the mean, binomialp2varname2nd percentiledistribution (sqrt(p(1-p)/n))..3rd 49th percentilessepoissonvarnamestandard error of the mean, Poissonp50varname50th percentile (median)distribution (sqrt(mean)).

3 51st 97th percentilessumvarnamesump98varname98th percentilerawsumvarnamesums ignoring optionally specified weightp99varname99th percentilecountvarnamecount of nonmissing observationsiqrvarnameinterquartile range12 table Flexible table of summary statisticsRows, columns, supercolumns, and superrows are thus defined asrow 1supercol 2col 1col 2col 1col 2row 1col 2row 1supercol 2col 1col 2col 1col 2superrow 1:row 2:row >Summaries, tables, and tests>Other tables>Flexible table of summary statisticsDescriptiontablecalculates and displays tables of Main contents(clist)specifies the contents of the table s cells; if not specified,contents(freq)is usedby (freq)produces a table of (mean mpg)producesa table of the means of (freq mean mpg sd mpg)produces a table offrequencies together with the mean and standard deviation of variablempg.

4 Up to five statisticsmay be (superrowvarlist)specifies that numeric or string variables be treated as superrows. Up to fourvariables may be specified insuperrowvarlist. Theby()option may be specified with thebyprefix. Options cellwidth(#)specifies the width of the cell in units of digit widths; 10 means the space occupied by10 digits, which is0123456789. The defaultcellwidth()is not a fixed number, but a numberchosen bytableto spread the table out while presenting a reasonable number of columns acrossthe Flexible table of summary statistics 3csepwidth(#)specifies the separation between columns in units of digit widths.

5 The default is nota fixed number, but a number chosen bytableaccording to what it thinks looks (#)specifies the width, in units of digit widths, to be allocated to the left stub of thetable. The default is not a fixed number, but a number chosen bytableaccording to what itthinks looks (#)specifies the separation between supercolumns in units of digit widths. The defaultis not a fixed number, but a number chosen bytableto present the results that results be centered in the table s cells.

6 The default is to right-align centering to work well, you typically need to specify a display format as (% )is that column labels be left-aligned. The default is to right-align column labels todistinguish them from supercolumn labels, which are casewise deletion. Ifcwis not specified, all observations possible are used to calculateeach of the specified relevant only when you request a table containing statisticson multiple variables. For instance,contents(mean mpg mean weight)would produce a tablereporting the means of variablesmpgandweight.

7 Consider an observation in whichmpgis knownbutweightis missing. By default, that observation will be used in the calculation of the mean ofmpg. If you specifycw, the observation will be excluded in the calculation of the means of that a row be added to the table reflecting the total across the that a column be added to the table reflecting the total across that a supercolumn be added to the table reflecting the total across that rows with all missing entries not be that missing statistics be shown in the table as periods ( Stata s missing-valueindicator).

8 The default is that missing entries be left that the data in memory be replaced with data containing 1 observation per cell(row, column, supercolumn, and superrow) and with variables containing the statistics designatedincontents().This option is rarely specified. If you do not specify this option, the data in memory you do specify this option, the first statistic will be namedtable1, the secondtable2, and soon. For instance, ifcontents(mean mpg sd mpg)was specified, the means ofmpgwould be invariabletable1and the standard deviations (string)is relevant only if you ()allows changing the default stubname thatreplaceuses to name the new variables associated with the statistics.

9 If you specifyname(stat), the first statistic will be placed in variablestat1, the second instat2, and so (%fmt)specifies the display format for presenting numbers in the table s (% )is the default;format(% )andformat(% )are popular alternatives. The width of theformat you specify does not matter, except that%fmtmust be valid. The width of the cells ischosen bytableto present the results best. Thecellwidth()option allows you to overridetable s table Flexible table of summary statisticsLimitsUp to four variables may be specified in theby(), so with the three row, column, and supercolumnvariables, seven-way tables may be to five statistics may be displayed in each cell of the sum of the number of rows, columns, supercolumns, and superrows is called the number ofmargins.

10 A table may contain up to 3,000 margins. Thus a one-way table may contain 3,000 rows. Atwo-way table could contain 2,998 rows and two columns, 2,997 rows and three columns,.., 1,500rows and 1,500 columns,.., two rows and 2,998 columns. A three-way table is similarly limitedby the sum of the number of rows, columns, and supercolumns. Ar c dtable is feasible ifr+c+d 3,000. The limit is set in terms of the sum of the rows, columns, supercolumns, andsuperrows, and not, as you might expect, in terms of their and are presented under the following headings:One-way tablesTwo-way tablesThree-way tablesFour-way and higher-dimensional tablesVideo exampleOne-way tablesExample 1 From the automobile dataset, here is a simple one-way table .


Related search queries