Hi, I am analyzing auction data with Stata.
What I would like to do is to generate a variable of equilibrium-bid from a variable called value.
value includes integers from 1 to 100. And I would like to generate equilibrium-bid from value. Unfortunately, I do not have an analytic form of bidding function. Instead, I have a numerical approximation of the bid function (ex 1-> 1.4, 2-> 1.7, 3-> 2.3, ......). So technically, I can generate equilibrium-bid by typing the following.
gen equilibrium-bid = 1.4 if value == 1
replace equilibrium-bid = 1.7 if value == 2
replace equilibrium-bid = 2.3 if value == 3
............
and so on.
But the problem is I have 100 types of values, so it will be inefficient to type 100 lines. Is there any ways to do the same job more conveniently?
Thanks,
Jinsoo
Related Posts with generating a variable with a custom transformation
Data import problemI have a problem in import the data set into STATA version 14. My data set has a sample value around…
Hausman test problemHi, I am doing a Hausman test and run 2 regressions, with re and fe. But for some reason i can do i…
error in panel dataHi, i am trying to set a panel data. I have a list of M&A deals during 2010-2010 and i want to a…
simplified codeI am not sure whether the following code works best for the purpose. Based on my data, it takes arou…
error in exporting graphsDear all, I have a problem with this code, because the first graph export goes well but the second t…
Subscribe to:
Post Comments (Atom)
0 Response to generating a variable with a custom transformation
Post a Comment