Announcement

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

  • repeated sample for bootstrap within the loop

    Hi ,

    I am doing bootstrap on different sets using the follow code:


    forval i = 1/50 {
    use "Z:\PCTU\HEALTH ECONOMICS\SCENE\HE analysis\full_database\missing_Imputation\P `i'.dta", clear
    bootstrap bootsdiff_cost=(delta_cost) bootsdiff_qaly=(delta_qaly), reps(20) seed(12345) saving(filec`i', replace): test
    }

    I am getting different filec files for different values of i, and each should contain 20 different pairs. However, I notice that the first pair is different, but from the second pair onward, the results are repeated. It seems that only two samples are being taken with variation, and for the other resamplings, the results are identical. This might be related to the seed or some other issue. Could you please guide me?

    BW
    Hiro
    Last edited by Hiro farabi; 21 Nov 2024, 10:53.

  • #2
    I have sat a seed in the program(test). it was the reason of this problem. by deleting it, resampling is fine.

    Comment

    Working...
    X