Example: biology

mean — Estimate means - Stata

Estimate meansDescriptionQuick startMenuSyntaxOptionsRemarks and examplesStored resultsMethods and formulasReferencesAlso seeDescriptionmeanproduces estimates of means , along with standard startMean, standard error, and 95% confidence interval forv1mean v1 Also compute statistics forv2mean v1 v2As above, but for each level of categorical variablecatvar1mean v1 v2, over(catvar1)Weighting by probability weightwvarmean v1 v2 [pweight=wvar]Population mean usingsvysetdatasvy: mean v3 Subpopulation means for each level of categorical variablecatvar2usingsvysetdatasvy: mean v3, over(catvar2)Test equality of two subpopulation meanssvy: mean v3, over(catvar2)test = tables, and tests>Summary and descriptive statistics>Means12 mean Estimate meansSyntaxmeanvarlist[if] [in] [weight] [,options]optionsDescriptionModelstdize( varname)variable identifying strata for standardizationstdweight(varname)weight variable for standardizationnostdrescaledo not rescale the standard weight variableif/in/overover(varlisto)group over subpopulations defined byvarlistoSE/Clustervce(vcetype)vcetypem ay beanalytic,clusterclustvar, bootstrap , orjackknifeReportinglevel(#)set confidence level; default islevel(95)noheadersu

vce(vcetype) vcetype may be analytic, cluster clustvar, bootstrap, or jackknife Reporting level(#) set confidence level; default is level(95) noheader suppress table header display options control column formats, line width, display of omitted variables and base and empty cells, and factor-variable labeling coeflegend display legend instead of ...

Tags:

  Name, Estimates, Bootstrap, Estimate means

Information

Domain:

Source:

Link to this page:

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

Other abuse

Advertisement

Transcription of mean — Estimate means - Stata

1 Estimate meansDescriptionQuick startMenuSyntaxOptionsRemarks and examplesStored resultsMethods and formulasReferencesAlso seeDescriptionmeanproduces estimates of means , along with standard startMean, standard error, and 95% confidence interval forv1mean v1 Also compute statistics forv2mean v1 v2As above, but for each level of categorical variablecatvar1mean v1 v2, over(catvar1)Weighting by probability weightwvarmean v1 v2 [pweight=wvar]Population mean usingsvysetdatasvy: mean v3 Subpopulation means for each level of categorical variablecatvar2usingsvysetdatasvy: mean v3, over(catvar2)Test equality of two subpopulation meanssvy: mean v3, over(catvar2)test = tables, and tests>Summary and descriptive statistics>Means12 mean Estimate meansSyntaxmeanvarlist[if] [in] [weight] [,options]optionsDescriptionModelstdize( varname)variable identifying strata for standardizationstdweight(varname)weight variable for standardizationnostdrescaledo not rescale the standard weight variableif/in/overover(varlisto)group over subpopulations defined byvarlistoSE/Clustervce(vcetype)vcetypem ay beanalytic,clusterclustvar, bootstrap , orjackknifeReportinglevel(#)set confidence level.

2 Default islevel(95)noheadersuppress table headerdisplayoptionscontrol column formats, line width, display of omitted variablesand base and empty cells, and factor-variable labelingcoeflegenddisplay legend instead of statisticsvarlistmay contain factor variables; see[U] Factor ,collect,jackknife,mi Estimate ,rolling,statsby, andsvyare allowed; see[U] ( bootstrap )andvce(jackknife)are not allowed with themi estimateprefix; see [MI]mi are not allowed with thebootstrapprefix; see [R] are not allowed with thejackknifeprefix; see [R] ()and weights are not allowed with thesvyprefix; see [SVY] ,aweights,iweights, andpweights are allowed; see[U] not appear in the dialog [U] 20 Estimation and postestimation commandsfor more capabilities of estimation Model stdize(varname)specifies that the point estimates be adjusted by direct standardization across thestrata identified byvarname.

3 This option requires thestdweight() (varname)specifies the weight variable associated with the standard strata identified inthestdize()option. The standardization weights must be constant within the standard the standardization weights from being rescaled within theover() option requiresstdize()but is ignored if theover()option is not specified. if/in/over over(varlisto)specifies that estimates be computed for multiple subpopulations, which are identifiedby the different values of the variables invarlisto. Only numeric, nonnegative, integer-valuedvariables are allowed inover(varlisto).mean Estimate means 3 SE/Cluster vce(vcetype)specifies the type of standard error reported, which includes types that are derived fromasymptotic theory (analytic), that allow for intragroup correlation (clusterclustvar), and thatuse bootstrap or jackknife methods ( bootstrap ,jackknife); see [R] (analytic), the default, uses the analytically derived variance estimator associated with thesample mean.

4 Reporting level(#); see [R]Estimation the table header from being :noomitted,vsquish,noemptycells,baseleve ls,allbaselevels,nofvlabel,fvwrap(#),fvw rapon(style),cformat(%fmt), andnolstretch; see [R]Estima-tion following option is available withmeanbut is not shown in the dialog box:coeflegend; see [R]Estimation and 1 Using the fuel data from example 3 of [R]ttest, we Estimate the average mileage of the carswithout the fuel treatment (mpg1) and those with the fuel treatment (mpg2).. use mean mpg1 mpg2 Mean estimation Number of obs = 12 Mean Std. err. [95% conf. interval]mpg121 .7881701 .9384465 these results, we can test the equality of the mileage between the two groups of test mpg1 = mpg2( 1) mpg1 - mpg2 = 0F( 1, 11) = > F = mean Estimate meansExample 2In example 1, the joint observations ofmpg1andmpg2were used to Estimate a covariance betweentheir matrix list e(V)symmetric e(V)[2,2]mpg1 mpg2mpg1.

5 62121212mpg2 .4469697 .88068182If the data were organized this way out of convenience but the two variables represent independentsamples of cars (coincidentally of the same sample size), we should reshape the data and use theover()option to ensure that the covariance between the means is use stack mpg1 mpg2, into(mpg) clear. rename _stack trt. label define trt_lab 1 "without" 2 "with". label values trt trt_lab. label var trt "Fuel treatment". mean mpg, over(trt)Mean estimation Number of obs = 24 Mean Std. err. [95% conf. interval] @trtwithout21 .7881701 .9384465 matrix list e(V)symmetric e(V)[2,2] @ 0 .88068182 Now, we can test the equality of the mileage between the two independent groups of test = 1) - = 0F( 1, 23) = > F = Estimate means 5 Example 3: standardized meansSuppose that we collected the blood pressure data from example 2 of [R]dstdize, and we wish toobtain standardized high blood pressure rates for each city in 1990 and 1992, using, as the standard,the age, sex, and race distribution of the four cities and two years combined.

6 Our rate is really themean of a variable that indicates whether a sampled individual has high blood pressure. First, wegenerate the strata and weight variables from our standard distribution, and then usemeanto computethe use , clear. egen strata = group(age race sex) if inlist(year, 1990, 1992)(675 missing values generated). by strata, sort: gen stdw = _N. mean hbp, over(city year) stdize(strata) stdweight(stdw)Mean estimationN. of std strata = 24 Number of obs = 455 Mean Std. err. [95% conf. interval] @city#year1 .0296273 .0004182 .11686571 .0113187 .03400832 .0238958 .0019121 .09583222 .007342 .0001455 .02900253 .0268566 .0483425 .15389983 .0227021 .0364435 .12567195 .0155121.

7 05826225 0 ..The standard error of the high blood pressure rate Estimate is missing for city 5 in 1992 becausethere was only one individual with high blood pressure; that individual was the only person observedin the stratum of white males 30 35 years default,meanrescales the standard weights within theover()groups. In the following, weuse thenostdrescaleoption to prevent this, thus reproducing the results in [R] mean hbp, over(city year) stdize(strata) stdweight(stdw) nostdrescaleMean estimationN. of std strata = 24 Number of obs = 455 Mean Std. err. [95% conf. interval] @city#year1 .0037034 .0000523 .01460821 .0014847 .0044612 .0038536 .0003084 .01545442 .0012633 .000025 .00499043 .0041238.

8 007423 .02363123 .0022772 .0036556 .0126065 .0021904 .00822685 0 ..6 mean Estimate meansExample 4: profile plots and contrastsThe first example in [R]marginsplotshows how to usemarginsandmarginsplotto get profileplots from a linear regression. We can similarly explore the data usingmarginsplotaftermeanwiththeover()op tion. Here we usemarginsplotto plot the means of systolic blood pressure for eachage use , clear. mean bpsystol, over(agegrp)Mean estimation Number of obs = 10,351 Mean Std. err. [95% conf..3247329 .4095845 .532033 .6061842 .4433527 + .8321116 marginsplotVariables that uniquely identify means :agegrp11012013014015020 2930 3940 4950 5960 6970+Age groupEstimated means of bpsystol with 95% CIsWe see that the mean systolic blood pressure increases with age.]

9 We can usecontrastto formallytest whether each mean is different from the mean in the previous age group using ; see [R]contrastfor more information on this Estimate means 7. contrast # , effects nowaldContrasts of meansContrast Std. err. t P>|t| [95% conf. interval]agegrp# (30--39vs20--29) .5226958 (40--49vs30--39) .6714302 (50--59vs40--49) .8065472 (60--69vs50--59) .7510133 (70+vs60--69) .9428528 first row of the output reports that the mean systolic blood pressure for the 30 39 age groupis higher than the mean for the 20 29 age group. The mean for the 40 49 age group is than the mean for the 30 39 age group, and so on. Each of these differences is significantlydifferent from can include bothagegrpandsexin theover()option to Estimate means separately for menand women in each age mean bpsystol, over(agegrp sex)Mean estimation Number of obs = 10,351 Mean Std.

10 Err. [95% conf..4528516 # .3898972 # .5619855 # .5572103 # .7080788 # .7802558 # .855435 # .8556015 # .6059786 # .6427981 +# +# mean Estimate means . marginsplotVariables that uniquely identify means :agegrpsex11012013014015020 2930 3940 4950 5960 6970+Age groupMaleFemaleEstimated means of bpsystol with 95% CIsAre the means different for men and women within each age group? We can again perform thetests usingcontrast. This time, we will obtain contrasts comparing men and womenand use@agegrpto request that the tests are performed for each age contrast # @agegrp, effects nowaldContrasts of meansContrast Std.]


Related search queries