Good evening everyone.
Hope someone can help me with my problem, and that I have managed to get this post approximatey right.
I have problems with missing values in my dataset when I try to export to .cvs-file.
My file is on this format:
AGE SEX HEIGHT WEIGHT sample_key alcohol_weekly audit_binary
71 Male 173.5 102.7 9384872_RO1 0.3234 1
66 Female 163.2 . 8234732_RO2 -0.983 0
etc.. The file contains some missing values for some of the observations.
I would like to export as a cvs-file, and I have been using this code:
The problem with the resulting cvs-file, is that if a value is missing, the variable after is shown in that column.
An example is posted below; the 4th individual is missing "alkohol_weekly_log", so the audit_binary has been moved to that column, i.e. in one colum there is a mixture of different variables.

I have been looking at the manual, this forum and googling without finding an explanation to my problem.
I have tried multple ways of exporting, using code, GUI, different export options, but the problem remain.
I am sorry if there is an obvious solution to my problem that I have not seen, but I hope someone can help me.
Regards
Sigrid Børte
Hope someone can help me with my problem, and that I have managed to get this post approximatey right.
I have problems with missing values in my dataset when I try to export to .cvs-file.
My file is on this format:
AGE SEX HEIGHT WEIGHT sample_key alcohol_weekly audit_binary
71 Male 173.5 102.7 9384872_RO1 0.3234 1
66 Female 163.2 . 8234732_RO2 -0.983 0
etc.. The file contains some missing values for some of the observations.
I would like to export as a cvs-file, and I have been using this code:
Code:
. export delimited using "/Users/sigridbo_adm/Documents/Migrene/Datafiler + variabler/Datafiler/Tromsøstudien/Alkohol/TromsoHarvest_Alkoho > l.csv", delimiter(tab) nolabel replace
An example is posted below; the 4th individual is missing "alkohol_weekly_log", so the audit_binary has been moved to that column, i.e. in one colum there is a mixture of different variables.
I have been looking at the manual, this forum and googling without finding an explanation to my problem.
I have tried multple ways of exporting, using code, GUI, different export options, but the problem remain.
I am sorry if there is an obvious solution to my problem that I have not seen, but I hope someone can help me.
Regards
Sigrid Børte
Comment