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
How to produce a table that shows the estimates of beta_cf and beta_dr for the 25 size BEME-sorted portfoliosHi Mr. Clyde Schechter and all STATALIST expert, I have an issue which i really appreciate the h…
Obtaining marginal effects for all possible predictsHi everyone, I was wondering to know how can I combine the below four margins commands in a single o…
Variable types for regressionsCan anybody let me know what are the variable types on which a regression can run? …
[HELP] Destring Variables DilemaHello Statalist -- Hope everyone is doing well. I am currently cleaning a dataset and am stumbling …
Extracting Year From DateHi, I have looked through older discussions and applied suggestions but my code returns an empty var…
Subscribe to:
Post Comments (Atom)
0 Response to Creating variable based on conditions of two variables using matrix
Post a Comment