Hi all,
I'm hoping you may be able to help/point me to guidance for some rather basic questions.
1) I have a list of ages, with a lot of missing data. To get the mean age is it best to use mean(AgeVar) or should I drop the missing values?
2) I'd like to create a new var for someone who has read topicXbin and topicYbin - I have 10 different topic_bins, and I want to create a new var for anyone who has a '1' in any 2 of these topic_bins. What's the best way of doing this?
3) Similarly, I have two binary variables and I would like to create a new one where someone is assigned a '1' if they have a '1' in either of the two variables - and a '0' if they have a '0' in both of them
4) Is it possible to sum across variables? For example, I have a 1/0 value in topic1bin, topic2bin, and topic3bin. Can I create a new var (topictotalbin) that would add all of the 1s in the three variables?
Thanks in advance for any guidance, and please let me know if any of the above isn't clear.
I'm hoping you may be able to help/point me to guidance for some rather basic questions.
1) I have a list of ages, with a lot of missing data. To get the mean age is it best to use mean(AgeVar) or should I drop the missing values?
2) I'd like to create a new var for someone who has read topicXbin and topicYbin - I have 10 different topic_bins, and I want to create a new var for anyone who has a '1' in any 2 of these topic_bins. What's the best way of doing this?
3) Similarly, I have two binary variables and I would like to create a new one where someone is assigned a '1' if they have a '1' in either of the two variables - and a '0' if they have a '0' in both of them
4) Is it possible to sum across variables? For example, I have a 1/0 value in topic1bin, topic2bin, and topic3bin. Can I create a new var (topictotalbin) that would add all of the 1s in the three variables?
Thanks in advance for any guidance, and please let me know if any of the above isn't clear.
Comment