Hello,
I just started using Stata, but I am wondering if it possible to create a new variable with existing data. I have monthly data from a broker for several years. I imported one month to get to know Stata better before I go on. I started to create a new excelfile with only the variables I need. With these variables I can create the performance of investors. The formula how I would use it in excel is as follows:
Performance = (x-(y-z))/(x2-y).
I tried to do this with Stata:
However, if I do it like this in Stata I get the error: "type mismatch R(109)".
I tried to find an answer in the FAQ on the stata website, without success. Therefore I am hoping if someone could explain if and how I can create this.
I just started using Stata, but I am wondering if it possible to create a new variable with existing data. I have monthly data from a broker for several years. I imported one month to get to know Stata better before I go on. I started to create a new excelfile with only the variables I need. With these variables I can create the performance of investors. The formula how I would use it in excel is as follows:
Performance = (x-(y-z))/(x2-y).
I tried to do this with Stata:
Code:
gen janperformance = (x - (y - z)) / (x2 - y)
I tried to find an answer in the FAQ on the stata website, without success. Therefore I am hoping if someone could explain if and how I can create this.