Hello Statalist
I have troubles with my data and i hope you can help me
My problem is that i have conducted a conjoint dataset. My total number of observations is 1251. In this dataset i have three rounds of 15 different dichotomous variables and that makes 45 diiferent dichotomous variabels. All respondets have answered three different of these. i have reshaped the dataset from long to wide and back to long again so my total numbers of observations increased to 1251x3 =3753. My problem is when i try to combine all my dichotomous variables into one combined dichotomous variabel my total number of observations is 1251 and not 3753. I think the problem is the way stata treats missing values. Because my 1251 observations have answered 3/45 different dichotomous variables, they are treated as missing values in the rest of the variables.
I have tried the replace command:
gen var1=.
replace var1=0 if var21 !=. & var22==0 | var22 !=. & var21==0 .... and so on but it doesn't work
egen var1, totalrow(varlist) will not work in my case either because i want my final variabel to be dichotomous aswell
I hope i have given you enough information to help me with me situation
Best regards
Rasmus
Related Posts with Combing dichotomous into one
xtabond2 command : Fix for the Arellano-Bond Test for Autocorrelation of order 1Is it really mandatory to reject the Null Hypothesis of the Arrelano-Bond AR(1)? If so, is there a …
Combining codes of different do filesI am trying to run the codes of two separate do files, combining them into the same do files. Each d…
Question on select data for a specific periodHi! I'm having trouble with data cleaning. My time_var data is in long format (eg. 31may2011) and af…
npregress intro manual replicate figuresHi, I'm looking for the code behind the figures in npregress intro manual https://www.stata.com/manu…
Moving entire folders to different directoriesHello: I am trying to use the command -mvfiles- which seems to be a good way to move/copy files from…
Subscribe to:
Post Comments (Atom)
0 Response to Combing dichotomous into one
Post a Comment