Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2023-06-08 20:17:48
Size: 575
Comment:
Revision 6 as of 2025-10-24 17:05:10
Size: 496
Comment: Rewrite
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The '''`drop`''' command is used to subset cases or variables. See also the [[Stata/Keep|keep]] command. '''`-drop-`''' subsets cases or variables.

See also [[Stata/Keep|-keep-]].
Line 13: Line 15:


=== Variables ===
Line 19: Line 17:
}}}
Line 21: Line 18:
drop if foo==1
Line 22: Line 20:

=== Cases ===

{{{
drop if foo==1
Line 36: Line 29:
The number of dropped rows is stored in `r(N drop)`. The number of dropped rows is stored in `r(N_drop)`.
Line 38: Line 31:
The number of dropped variables is stored in `r(k drop)`. The number of dropped variables is stored in `r(k_drop)`.
Line 46: Line 39:
[[https://www.stata.com/manuals/ddrop.pdf|Stata manual for drop]] [[https://www.stata.com/manuals/ddrop.pdf|Stata manual for -drop-]]

Stata Drop

-drop- subsets cases or variables.

See also -keep-.


Usage

drop foo bar baz

drop if foo==1

drop in 1/10


Stored Results

The number of dropped rows is stored in r(N_drop).

The number of dropped variables is stored in r(k_drop).


See also

Stata manual for -drop-


CategoryRicottone

Stata/Drop (last edited 2025-10-24 17:05:10 by DominicRicottone)