Example: marketing

Immediate commands - Stata

19 Immediate list of the Immediate display power OverviewAnimmediatecommand is a command that obtains data not from the data stored in memory butfrom numbers typed as arguments. Immediate commands , in effect, turn Stata into a glorified are many instances when you may not have the data, but you do know something about thedata, and what you know is adequate to perform statistical tests. For instance, you do not have tohave individual-level data to obtain the standard error of the mean, and thereby a confidence interval,if you know the mean, standard deviation , and number of observations.

is 24, that the standard deviation is 6, and that there are 97 cars in the sample, we can calculate . cii 97 24 6 Variable Obs Mean Std. Err. [95% Conf. Interval]

Tags:

  Name, Standards, Command, Immediate, Deviation, Standard deviation, Immediate commands

Information

Domain:

Source:

Link to this page:

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

Other abuse

Transcription of Immediate commands - Stata

1 19 Immediate list of the Immediate display power OverviewAnimmediatecommand is a command that obtains data not from the data stored in memory butfrom numbers typed as arguments. Immediate commands , in effect, turn Stata into a glorified are many instances when you may not have the data, but you do know something about thedata, and what you know is adequate to perform statistical tests. For instance, you do not have tohave individual-level data to obtain the standard error of the mean, and thereby a confidence interval,if you know the mean, standard deviation , and number of observations.

2 In other instances, you mayactually have the data, and you could enter the data and perform the test, but it would be easier ifyou could just ask for the statistic based on a summary. For instance, you flip a coin 10 times, and itcomes up heads twice. You could enter a 10-observation dataset with two ones (standing for heads)and eight zeros (meaning tails). Immediate commands are meant to solve those problems. Immediate commands have the followingproperties:1. They never disturb the data in memory. You can perform an Immediate calculation as an asidewithout changing your The syntax for these commands is the same, the command name followed by numbers, whichare the summary statistics from which the statistic is calculated.

3 The numbers are almost alwayssummary statistics, and the order in which they are specified is in some sense natural .3. Immediate commands all end in the letteri, although the converse is not true. Usually, if thereis an Immediate command , there is a nonimmediate form also, that is, a form that works on thedata in memory. For every statistical command in Stata , we have included an Immediate form ifit is reasonable to assume that you might know the requisite summary statistics without havingthe underlying data and if typing those statistics is not absurdly Immediate commands are documented along with their nonimmediate counterparts.

4 Thus, if youwant to obtain a confidence interval, whether it be from summary data with an Immediate commandor using the data in memory, use the table of contents or index to discover that [R]cidiscussesconfidence intervals. There, you learn thatcicalculates confidence intervals by using the data inmemory and thatciidoes the same with the data specified immediately following the [ U ] 19 Immediate ExamplesExample 1 Let s take the example of confidence intervals. Professional papers often publish the mean, standarddeviation, and number of observations for variables used in the analysis.

5 Those statistics are sufficientfor calculating a confidence interval. If we know that the mean mileage rating of cars in some sampleis 24, that the standard deviation is 6, and that there are 97 cars in the sample, we can calculate. cii 97 24 6 VariableObs Mean Std. Err. [95% Conf. Interval]97 24 .6092077 learn that the mean s standard error is and its 95% confidence interval is[ , ].To obtain this, we typedcii(the Immediate form of thecicommand) followed by the numberof observations, the mean, and the standard deviation . We knew the order in which to specify thenumbers because we had read [R] could use the Immediate form of thettestcommand to test the hypothesis that the true meanis 22.

6 Ttesti 97 24 6 22 One-sample t testObs Mean Std. Err. Std. Dev. [95% Conf. Interval]x97 24 .6092077 6 = mean(x) t = : mean = 22 degrees of freedom = 96Ha: mean < 22 Ha: mean != 22 Ha: mean > 22Pr(T < t) = Pr(|T| > |t|) = Pr(T > t) = first three numbers were as we specified in a fourth number,which is the constant against which the mean is being tested; see [R] 2We mentioned flipping a coin 10 times and having it come up heads twice.

7 The 99% confidenceinterval can also be obtained fromci:. cii 10 2, level(99)Binomial ExactVariableObs Mean Std. Err. [99% Conf. Interval]10 .2 .1264911 .0108505 .6482012In the previous example, we specifiedciiwith three numbers following it; in this example, wespecify 2. Immediate commands often determine what to do by the number of arguments followingthe command . With two arguments,ciassumes that we are specifying the number of trials andsuccesses from a binomial experiment; see [R]ci.[ U ] 19 Immediate commands 3 The Immediate form of thebitestcommand performs exact hypothesis testing.

8 Bitesti 10 2 .5N Observed k Expected k Assumed p Observed p10 2 5 (k >= 2) = (one-sided test)Pr(k <= 2) = (one-sided test)Pr(k <= 2 or k >= 8) = (two-sided test)For a full explanation of this output, see [R] 3 Stata stabulatecommand makes tables and calculates various measures of association. Theimmediate form,tabi, does the same, but we specify the contents of the table following thecommand:. tabi 5 10 \ 2 14colrow1 2 Total15 101522 1416 Total7 2431 Fisher s exact = Fisher s exact = is slightly different from most Immediate commands because it uses \ toindicate where one row ends and another [ U ] 19 Immediate A list of the Immediate commandsCommandReferenceDescriptionbites ti[R]bitestBinomial probability testcci[ST]epitabTables for epidemiologistscsiirimccicii[R]ciConfide nce intervals for means, proportions, and countsesizei[R]esizeEffect size based on mean comparisonprtesti[R]

9 PrtestTests of proportionssdtesti[R]sdtestVariance comparison testssymmi[R]symmetrySymmetry and marginal homogeneity teststabi[R]tabulate twowayTwo-way tables of frequenciesttesti[R]ttestMean comparison teststwoway pci[G-2]graph twoway pciPaired-coordinate plot with spikes or linestwoway pcarrowi[G-2]graph twoway pcarrowiPaired-coordinate plot with arrowstwoway scatteri[G-2]graph twoway scatteriTwoway The display commanddisplayis not really an Immediate command , but it can be used as a hand display 2+57. display sqrt(2+sqrt(3^2-4*2*-2))/(2*3).44095855 See [R] The power commandpoweris not technically an Immediate command because it does not do something on typednumbers that another command does on the dataset.

10 It does, however, work strictly on numbers youtype on the command line and does not disturb the data in power and sample-size analysis. SeeStata Power and Sample-Size ReferenceManual.


Related search queries