我在 Stata 中的变量采用以下形式:
First Name: Allen
Last Name: Von Schmidt
Birth Year: 1965
County: Cape May
State: New Jersey
First Name: Lee Roy
Last Name: McBride
Birth Year: 1967
County: Cook
State: Illinois
我希望outsheet
他们在 .txt 中创建引号和逗号分隔的行:
"Allen,"Von Schmidt","1965","Cape May","New Jersey"
"Lee Roy","McBride","1967","Cook","Illinois"
我怎样才能使用outsheet
(或其他命令)来做到这一点?我需要先将数字变成字符串吗?我需要先为每个变量添加逗号吗?
我尝试了以下方法:
outsheet first last birth_year county state using FileName.txt, nolabel delim(",")
这似乎工作正常,只是它没有将数字变量放在“”内。