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
How to rename variable name with the variable label in a loopI created new variables based on the levels of a categorical variable using the -tab, gen- command a…
Why non missing conflict?Hello, I'm saving a database in CSV format, then merging it again in. It generates a nonmissing conf…
How to do a Propensity Score Matching and a Parallel Trend Test for a Staggered Difference in Difference DesignDear all, I am still learning Stata, currently using Stata 14.2. Thank you very much in advance fo…
Dealing with duplicate time stamps in auction dataHello! I am working with a longitudinal panel dataset collected from an online auction. For each ob…
How to create a balance plot after weighting manually?I created weights for a difference-in-difference model and want to compare the correlations of the c…
Subscribe to:
Post Comments (Atom)
0 Response to generating a variable with a custom transformation
Post a Comment