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
Batch mode: "The do file was interrupted. Would you like the batch job to continue?"In reply to Jason A. Thompson's question from 2007-11-20: After upgrading to Stata 10, batch job…
specifying stored coefficients in testI am running two multilevel models and storing the coefficients. I then want to test of the product …
Make a list table in StataDear Stata users, Thank you in advance. I want to make a table that has all items listed in cells t…
Separating a character and a number part of a variableI have a variable consisting of characters and numbers in a string format. How can I separate the ch…
How to use If condition to restrict t test on only two groups with a categorical var that has 3 groupsHi Family, I have 1 categorical variable that has 3 grps( blue,yellow, green), I wanted check if the…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variable based on conditions of two variables using matrix
Post a Comment