Hi,
I'm sorry if this is an already responded to question that I have just been unable to find in the list, but I have searched the Stata manual, this list and many other sources for several days and not been able to find a response that I could adjust to my situation.
I need to find a way to bootstrap the mean and 95% confidence intervall for a difference in a (cost) variable between two groups (usual treatment vs intervention group, unmatched and different size groups), i.e., a bootstrapped alternative to the difference-results provided after a t-test. Thus, I do not want to test the difference, which I think I have found a code for.
I have understod that I need to create an ado-file for this, but I have so far got stuck on how to create the code in that ado-file, and what code should remain in the do-file. Moreover, I will need to do this for several (many) cost-variables, what I am hoping is that it will be possible to create an ado-file that can be re-used for many variables, but so far the suggestions I have found for this type of code (e.g., http://www.stata.com/statalist/archi.../msg00123.html and several other similar examples) have used the variable names. The only exception has been the code provided in the Stata manual (example 4 under Bootstrap is for bootstrapping a ratio, so similar but not exactly what I need, uses ‘y’ and ‘x’ for the variables, but maybe this is just to clarify what is what), but instead that code is so different in how it is written so that I end up getting stuck on trying to figure out how to compare between the codes from different sources.
* Does anyone have suggestions for how to write such a code for getting a bootstraped version of this difference in means and 95% confidence intervall?
* Can I instruct such an ado-program to use alternative y-variables (or do I have to to all of this in a loop that changes my variable names before calling each y-variable and making the calculations)?
* How do I call this program from my do-file (where does the code in the do-file "start")?
(* An additional question is if this also will work when the dataset incorporates multiple imputation results, which I will need to handle eventually?)
Would be happy to get any suggestions on how to handle this since I have really got stuck.
Kind regards,
Hanna
I'm sorry if this is an already responded to question that I have just been unable to find in the list, but I have searched the Stata manual, this list and many other sources for several days and not been able to find a response that I could adjust to my situation.
I need to find a way to bootstrap the mean and 95% confidence intervall for a difference in a (cost) variable between two groups (usual treatment vs intervention group, unmatched and different size groups), i.e., a bootstrapped alternative to the difference-results provided after a t-test. Thus, I do not want to test the difference, which I think I have found a code for.
I have understod that I need to create an ado-file for this, but I have so far got stuck on how to create the code in that ado-file, and what code should remain in the do-file. Moreover, I will need to do this for several (many) cost-variables, what I am hoping is that it will be possible to create an ado-file that can be re-used for many variables, but so far the suggestions I have found for this type of code (e.g., http://www.stata.com/statalist/archi.../msg00123.html and several other similar examples) have used the variable names. The only exception has been the code provided in the Stata manual (example 4 under Bootstrap is for bootstrapping a ratio, so similar but not exactly what I need, uses ‘y’ and ‘x’ for the variables, but maybe this is just to clarify what is what), but instead that code is so different in how it is written so that I end up getting stuck on trying to figure out how to compare between the codes from different sources.
* Does anyone have suggestions for how to write such a code for getting a bootstraped version of this difference in means and 95% confidence intervall?
* Can I instruct such an ado-program to use alternative y-variables (or do I have to to all of this in a loop that changes my variable names before calling each y-variable and making the calculations)?
* How do I call this program from my do-file (where does the code in the do-file "start")?
(* An additional question is if this also will work when the dataset incorporates multiple imputation results, which I will need to handle eventually?)
Would be happy to get any suggestions on how to handle this since I have really got stuck.
Kind regards,
Hanna
Comment