[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
Re: AW: st: Weibull |

Date |
Sun, 8 Mar 2009 18:59:54 +0100 |

<>

HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Sunday, March 08, 2009 6:53 PM Subject: Re: AW: st: Weibull

Dear Muhammad and Martin, Your emails are greatly appreciated.The objective is to create 4 different columns (variables) with dataconforming to the Weibull distribution ( timevar1, eventvar1/ timevar2,eventvar2) and then test to see whether there is a statistical differencebetween the two weibull variables regarding the events in conjunction withtime .Then use exactly the same dataset, count the events for the two differentgroups and see if there is a difference (chi2) when analysing them withouttaking in account the time information. The aim would be to show how theresults of the analysis might differ when using the two different ways toanalyse the same data.I would like to generate weibull data with different parameters and redothe above tests, and finally graph them.Any assistance would be appreciated since this is unfamiliar territory forme.Also the code you have posted says version 9.2-is this from an older Stataversion?I am producing gamma distribution or weibull with the code you havecreated?Thank you so much for taking the time to read and respond to my emails. Best wishes, Nikolaos --- On Sun, 3/8/09, Martin Weiss <martin.weiss1@gmx.de> wrote: From: Martin Weiss <martin.weiss1@gmx.de> Subject: AW: st: Weibull To: statalist@hsphsun2.harvard.edu Date: Sunday, March 8, 2009, 4:49 PM <> I think you can economize on lines here: ************* capture program drop wsim program define wsim version 9.2 syntax [, obs(integer 1) lambda(real 0.8) gamma(real 0.4) ] drop _all set obs `obs' tempvar time event gen `time' = ((log(1-uniform()))/-`lambda')^(1/`gamma') summarize `time', mean end simulate time=r(mean), reps(1000): wsim, obs(100) gen event= time< 5 ************* HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Muhammad Riaz Gesendet: Sonntag, 8. März 2009 15:45 An: statalist@hsphsun2.harvard.edu Betreff: Re: st: Weibull Hi Nikolaos, You might have sorted out your simulation from weibull, I just managed to write the codes given below: I thought it may help to thread it here in connection to your query for simulation from weibull and get further advices from others. capture program drop wsim program define wsim, rclass version 9.2 syntax [, obs(integer 1) lambda(real 0.8) gamma(real 0.4) ] drop _all set obs `obs' tempvar time event gen `time' = ((log(1-uniform()))/-`lambda')^(1/`gamma') summarize `time' return scalar mean = r(mean) end simulate time=r(mean) , reps(1000): wsim, obs(100) gen event= time< 5 HTH Muhammad Riaz --- On Mon, 3/2/09, Nikolaos Pandis <npandis@yahoo.com> wrote: From: Nikolaos Pandis <npandis@yahoo.com> Subject: Re: st: Weibull To: statalist@hsphsun2.harvard.edu Date: Monday, March 2, 2009, 9:48 PM Dear Bobby, Thank you very much for the posting.I have the previous version of the book on survival analysis with Statathatyou have coauthored with M. Cleves and W. Gould. Any sections in therethatwill help me with the current problem? Best wishes, Nikolaos --- On Mon, 3/2/09, Roberto G. Gutierrez, StataCorp <rgutierrez@stata.com> wrote: From: Roberto G. Gutierrez, StataCorp <rgutierrez@stata.com> Subject: Re: st: Weibull To: statalist@hsphsun2.harvard.edu Date: Monday, March 2, 2009, 6:15 PM Nikolaos Pandis <npandis@yahoo.com> asks:I would like to generate continuous data for two groups for which I would like to evaluate whether there is a difference between their means (Icoulduse use a t-test). I would like to be able to set the mean and sd of thetwogroups. The data would represent bond failure strength (in MPa) of two different materials (the 2 groups).Additionally, I would like to generate data for the same experiment that follows the Weibull distribution and compare the two groups.It is of interest to see the results of the analysis on the data underthettest analysis and under an analysis suitable for the Weibulldistribution.The objective is to show how different analyses of similar data mightpointto different results, and the importance of selecting the correct distribution and analysis.Nikolaos has already received some very good advice, to which I would only add that I have written the routine -gengammareg- available via . findit gengammareg -gengammareg- generates data from gamma regression as implemented by -streg-, but also includes as special cases the exponential, Weibull and lognormal distributions; see -help gengammareg- after installing. The two-sample test Nikolaos describes can be retooled as regression on a dummy variable, allowing the use of -gengammareg- here. --Bobby rgutierrez@stata.com * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**Follow-Ups**:**RE: AW: st: Weibull***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**Re: AW: st: Weibull***From:*Nikolaos Pandis <npandis@yahoo.com>

- Prev by Date:
**Re: AW: st: Weibull** - Next by Date:
**st: RE: [Fwd: re: simultaneous equations]** - Previous by thread:
**Re: AW: st: Weibull** - Next by thread:
**RE: AW: st: Weibull** - Index(es):

© Copyright 1996–2016 StataCorp LP | Terms of use | Privacy | Contact us | What's new | Site index |