new variable

  1. P

    How to identify 3 most frequent responses and turn them into new variables.

    Hello! I have a data set of 1000 individuals (rows) and (for this example) 18 likert-scale 5-item item responses in the columns. So the data for one person might look like this: SubjectA1 1 1 2 1 2 3 5 3 4 1 1 1... etc. I want to generate 6 new variables. 3 for each of the most common 3...
  2. M

    Creating a new variable from several existing ones

    Hello, I already have ID variable, DATE variable, and now I want to create a new variable that will assign a certain number (say new id) to each firm considering a year(!) observation (NOT a whole period of 2000-2002), and generally will show the following: For example...
  3. M

    How to save constant terms (_cons) as a new variable in STATA.

    Hello, I have an unbalanced panel data. I examine 850 mutual funds during the period of 2000-2013. I ran regressions to estimate performance by using Carhart 4 factor model. Specifically, I have used the Carhart alpha in the prior 12 months as a measure of risk-adjusted performance. Thus I...
  4. A

    Comparing values of subsequent cases (syntax)

    Hi! I'm stuck with a seemingly simple problem (comparing values One variable - Multiple cases). Please help! This is what I want to do: I have records for a variable for different participants for several subsequent months, that is there is more than one case for each participant (number of...
  5. P

    Creating new variable?

    I think what I need to do is create/compute a new variable, but I'm not sure. I'm looking at incidence of cavities in teeth. The way I collected the data is by individual tooth were 0 = no cavities, 1 = one cavity, 2 = one or more cavity in the tooth. But now I want to look at the incidence...
  6. G

    generating new variable

    Panel Data Generating New Variable Conditional on Another Hi everyone, I would appreciate if anyone could help me with the following problem: I have 4 brands - A,B,C,D - for each of them I have monthly advertising expenditure (Adv) and now I want to create a new variable (AdvComp) which...