Hi,
I strongly suspect this question has been answered elsewhere but I haven't found it (possibly because I'm not really sure how to pose the question articulately).
I am wondering if there is a simple, "automated" way to change the values associated with a given value label. For example, say I have the following variable ('smoke'):
How often do you smoke?
1=never
2=once a week or less
3=every few days
4=most days
5=every day
But lets say that I would like this variable coded so that never=0.
This could be done via the following command:
replace smoke = smoke-1
The issue here is that while the values have changed, the value labels have not.
Is there a way to convert the value labels to the following without running 'label define ...., replace'?
0=never
1=once a week or less
2=every few days
3=most days
4=every day
I'm thinking something along the lines of the completely made up:
replace smoke_label = smoke_label - 1
Kind regards,
Owen Gallupe
I strongly suspect this question has been answered elsewhere but I haven't found it (possibly because I'm not really sure how to pose the question articulately).
I am wondering if there is a simple, "automated" way to change the values associated with a given value label. For example, say I have the following variable ('smoke'):
How often do you smoke?
1=never
2=once a week or less
3=every few days
4=most days
5=every day
But lets say that I would like this variable coded so that never=0.
This could be done via the following command:
replace smoke = smoke-1
The issue here is that while the values have changed, the value labels have not.
Is there a way to convert the value labels to the following without running 'label define ...., replace'?
0=never
1=once a week or less
2=every few days
3=most days
4=every day
I'm thinking something along the lines of the completely made up:
replace smoke_label = smoke_label - 1
Kind regards,
Owen Gallupe
Comment