Hi, I have a dataset below that has 6 columns .
I would like to check if [ not missing in any of the columns in A B C] and [not missing X Y Z ] then a new column should be created which get a value 1, otherwise it get a value 0.
input str10(A B C X Y Z)
"Yes" " " "No" "Yes" "Maybe" "Sometimes"
"No" "No" "Maybe" "Yes" "Yes" "Yes"
" " "Yes" "No" "Sometimes" "No" " "
"Yes" "No" " " "No" "Sometimes" "No"
"Yes" "Yes" "Sometimes" "No" "No" "No"
" " " " " " " " "" ""
"Sometimes" "No" " " " " " " " "
end;
Related Posts with conditionally check if 2 column clusters have no missing values
How to avoid duplicates using rangejoin?Hello everyone! My goal is matching firms from two datasets with minimum difference in their Market…
Filling a time-invariant dummy variable down for new years in panel data after expanding a datasetHi I am looking to fill in missing observations for a dummy variable for firms (which each have an …
Creating treatment and control groups for regression modelThis is a continuation of my previous post Grouping values within a variable that Clyde Schechter ha…
Transpose (rotating) data by group (variable)Dear all, I need to transpose my dataset so that I can calculate the pairwise correlation matrix fo…
Latent class analysis (LCA) plugin - assertion is false -errorHello, I've been trying to use the LCA plugin from Penn State for my analysis using Stata/IC. I succ…
Subscribe to:
Post Comments (Atom)
0 Response to conditionally check if 2 column clusters have no missing values
Post a Comment