-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfussydrop.ado
37 lines (24 loc) · 842 Bytes
/
fussydrop.ado
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/***
Title
======
__fussydrop__ -- a helper function to drop only those variables that exactly match the variable name.
Syntax
------
__syntax__ varname
- - -
Required:
> __varname__ : a variable name
- - -
Description
-----------
__fussydrop__ will drop only drop those variables that exactly match the variable name. This function was written by NJ Cox in response to a question on the STATA help list [here](http://www.stata.com/statalist/archive/2002-08/msg00184.html). I use this function often within the __rms__ family of commands which is why it is included in the package.
***/
*capture program drop fussydrop
program def fussydrop
*! NJC 1.1.0 9 August 2002
//http://www.stata.com/statalist/archive/2002-08/msg00184.html
version 7
syntax varname
args myvar
if "`varlist'" == "`myvar'" { drop `myvar' }
end