Hello!
I am trying to create a new variable based off other variables. I need to add them, but I also need to give each of the variables different weights. The problem I'm running into is that Stata seems to be ignoring all the responses that have at least one missing value (which is basically all of them). Specifically, the Q13_x#'s are variables about social media usage, and since not every respondent uses every social medium, many responses have missing data. I considered using the rowtotal command, but then I don't know how to use the weights. I also considered adding weights to those variables, but they are different for each new variable I'm trying to create. I'm writing the commands I have been working with below. However, every time I try to use these, it says that there are "No observations". Any advice? I'm still very new to Stata, so I really appreciate your help in advance.
gen interactivity = (Q13_x1 * 1.00 + Q13_x2 * 1.00 + Q13_x3 * .67 + Q13_x4 * .67 + Q13_x5 * .67 + Q13_x6 * .33 + Q13_x7 * .33 + Q13_x8 * 1.00)
gen socialcues = (Q13_x1 * .67 + Q13_x2 * 1.00 + Q13_x3 * 1.00 + Q13_x4 * .67 + Q13_x5 * 1.00 + Q13_x6 * 1.00 + Q13_x7 * 1.00 + Q13_x8 * 1.00)
gen reach = (Q13_x1 * .67 + Q13_x2 * .67 + Q13_x3 * .33 + Q13_x4 * .33 + Q13_x5 * .33 + Q13_x6 * 1.00 + Q13_x7 * 1.00 + Q13_x8 * .67)
gen tempstructure = (Q13_x1 * 1.00 + Q13_x2 * .33 + Q13_x3 * .33 + Q13_x4 * 1.00 + Q13_x5 * 1.00 + Q13_x6 * .33 + Q13_x7 * .33 + Q13_x8 * .33)
I am trying to create a new variable based off other variables. I need to add them, but I also need to give each of the variables different weights. The problem I'm running into is that Stata seems to be ignoring all the responses that have at least one missing value (which is basically all of them). Specifically, the Q13_x#'s are variables about social media usage, and since not every respondent uses every social medium, many responses have missing data. I considered using the rowtotal command, but then I don't know how to use the weights. I also considered adding weights to those variables, but they are different for each new variable I'm trying to create. I'm writing the commands I have been working with below. However, every time I try to use these, it says that there are "No observations". Any advice? I'm still very new to Stata, so I really appreciate your help in advance.
gen interactivity = (Q13_x1 * 1.00 + Q13_x2 * 1.00 + Q13_x3 * .67 + Q13_x4 * .67 + Q13_x5 * .67 + Q13_x6 * .33 + Q13_x7 * .33 + Q13_x8 * 1.00)
gen socialcues = (Q13_x1 * .67 + Q13_x2 * 1.00 + Q13_x3 * 1.00 + Q13_x4 * .67 + Q13_x5 * 1.00 + Q13_x6 * 1.00 + Q13_x7 * 1.00 + Q13_x8 * 1.00)
gen reach = (Q13_x1 * .67 + Q13_x2 * .67 + Q13_x3 * .33 + Q13_x4 * .33 + Q13_x5 * .33 + Q13_x6 * 1.00 + Q13_x7 * 1.00 + Q13_x8 * .67)
gen tempstructure = (Q13_x1 * 1.00 + Q13_x2 * .33 + Q13_x3 * .33 + Q13_x4 * 1.00 + Q13_x5 * 1.00 + Q13_x6 * .33 + Q13_x7 * .33 + Q13_x8 * .33)
Comment