.- help for ^coll2^ (STB-24: dm27) .- Make data set of means, medians, etc. ------------------------------------- ^coll2^ clist [weight] [^if^ exp] [^in^ range] [^,^ ^by(^varlist^)^ ^cw^] where clist is [^(^tspec^)^] varlist [ [^(^tspec^)^] ... ] [^(^tspec^)^] target_var^=^varname [target^=^varname ...] [ [^(^tspec^)^ ...] or any combination of the varlist or target_var forms, and tspec is ^mean^ means ^sd^ standard deviations ^sum^ sums ^rawsum^ sums ignoring optionally specified weight ^count^ number of nonmissing observations ^max^ maximums ^min^ minimums ^median^ medians ^p1^ 1st percentile ^p2^ 2nd percentile ... ^p50^ 50th percentile (same as ^median^) ... ^p98^ 98th percentile ^p99^ 99th percentile ^iqr^ interquartile range ^aweight^s and ^fweight^s are allowed; see help @weights@. Description ----------- ^coll2^, an alternative to @collapse@, converts the data in memory into a data set of means, sums, medians, etc. Options ------- ^by(^varlist^)^ specifies the groups over which the means, etc., are to be calcu- lated. If not specified, the resulting data set will contain one obser- vation. If specified, varlist may refer to either string or numeric variables. ^cw^ specifies casewise deletion. If not specified, all observations possible are used for each calculated statistic. Examples -------- . ^coll2 age educ income, by(state)^ . ^coll2 (mean) age educ income, by(state)^ . ^coll2 (median) age educ income, by(state)^ . ^coll2 (mean) age educ (median) income, by(state)^ . ^coll2 (mean) age educ income (median) medinc=income, by(state)^ . ^coll2 (mean) age-income (median) medinc-income medage=age, by(state)^ . ^coll2 (mean) age educ income (median) medinc=income, by(state) cw^ . ^coll2 (mean) age-income (median) medage=age [w=pop], by(region)^ Also see -------- STB: dm27 (STB-24) On-line: help for @collapse@, @egen@, @summarize@