|
G'day mates!
Today I have two questions:
1) I have a large dataset, containing people's social security numbers and
their income. No I want to select e.g. two percent of the people in the
table AT RANDOM, and change their income by 10 percent. How do I
accomplish this?
2) Depending on what income, and the social status (married, divorced,
etc.) the people above have, I want to give them a certain score. I have
(on paper) a list of which income interval and social status goes with
which score. Now I want to take the income variable in the table in 1),
compare with my "lookup table", and assign the apropriate score to evey
person. How do I do this the best way? Do I use a lot of IF:s? Or can I
create a table containing income intervals, social status and the
corresponding score, and look up values in some clever way?
Thanks lots!
|