Dear everyone
I'm trying to create a variable based on matrix conditions of two other variable.
I acknowledge that the the screenshoot is not the best way to show you the data but this is my starting point:
On stata, I have the variable a and b and I need to create the variable c based on the values of a and b (below the conditions)
For instance if 0<=a<0.1 and 0<=b<10, then c = 0.005
Do you have any advice on how to approach it that is best time-efficient (i.e. without manually including all conditions with if/or commands)?
Array
Related Posts with Creating variable based on conditions of two variables using matrix
Mapmaking with shp2dta and spmapI am trying to make a map of Chicago in Stata. I want this map to include borders for neighborhoods …
adjusted length of stayHello, Can anybody help to understand how can I calculate the risk-adjusted length of stay (LOS), I …
Overlay graphs in Panel data without -collapse- or creating by group averagesHi, If we collapse data, we essentially create new data set containing averaged values. By creating…
Counting the occurrence of “directors name”Hello respected experts, I am counting the number of times the same director has served on a board,…
Graph: xlabel using by() and over() optionsHi all, I wonder if its possible use use xlabel options with by and over, example: Code: clear al…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variable based on conditions of two variables using matrix
Post a Comment