Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Keeping data in memory

    Dear Listers,

    I have 2 small datasets in Stata. One contains some estimation parameters for different conditions: I have 4 possible scenario which corresponds to different ratios (based on assumptions); the ratios are calculated based on grouped data within the dataset

    scenario lambda
    A 0.2
    B 0.4
    C 0.6
    D 0.8


    I would then like to apply those estimated ratios (lambdas) to a a second dataset to estimate the number of observations based on each of the 4 scenarios to allocate the number of responses to be 20% vs. 80% in group 1 and 2, respectively under scenario A for example.

    I am not sure I can easily merge the two datasets as they don't have a shared variable - is there any way I can call parameters from dataset one into dataset two or should I use local macros?

    Thanks!


  • #2
    -help cross- will create four observations for each observation originally in the second data set, one for each of the four scenarios.

    That said, I think in some situations like this, with only four scenarios, I would just create local macros lambda_A, lambda_B, lambda_C, and lambda_D with the corresponding values and use those with the second data set.

    Which approach is better would depend on exactly what you are going to be doing.

    Comment

    Working...
    X