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
Is this video correct?I am new to stata. I am trying to learn about loops. I searched youtube I found this video. Is this …
How to create an index variable and analyze i vs. i - 1 (long data)How could I create a variable called test_index to enumerate (from 1 to ...) the tests for each reco…
Partial F Test or Chow TestStata users I've been searching for a long time. How I can I perform an partial f test in stata? …
xtabond2 GMM: No Observation ErrorHi, I have an unbalanced panel comprising of data from the years 2005 and 2011. I am trying to run …
Different Number of Observations when using 2SLS and IVprobitHi. I am examining the impact of the migration of one member on children in the migrant's household.…
Subscribe to:
Post Comments (Atom)
0 Response to generating a variable with a custom transformation
Post a Comment