STATA学习笔记: 变量 |
您所在的位置:网站首页 › stata如何设置变量名 › STATA学习笔记: 变量 |
STATA学习笔记: 变量
1.新建变量
gen 变量名=变量值
egen 变量名=变量值
2. 变量重命名
(1)单个变量重命名 rename 旧变量名 新变量名 rename make mk(2)批量重命名 rename (旧变量1 旧变量2 旧变量3) (新变量1 新变量2 新变量3) rename (price mpg) (price1 mpg1) rename rep78 headroom, upper //upper选项,将rep78和headroom变量名修改为大写添加变量标签,对变量进一步说明 (1)variable label:为变量添加/修改标签 webuse hbp4,clear des原始数据
Description lookfor_all is an extension of the Stata program lookfor. lookfor_all searches through all Stata data files in a current directory and subdirectories for the variable(s) with at least one of the specified patterns. Each pattern could be a part/whole variable name and/or a word (part of the word) in the variable label. lookfor_all outputs the list of data files where the pattern was found and the list of variables within every data file that match the pattern. (3)findnameDescription findname lists variable names of the dataset currently in memory in a compact or detailed format, and lets you specify subsets of variables to be listed, either by name or by properties (e.g., the variables are numeric). In addition, findname leaves behind in r(varlist) the names of variables selected so that you can use them in a subsequent command. webuse nlswork,clear findname //All variables |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |