[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: st: RE: Manipulation of the distribution |

Date |
Mon, 10 Nov 2008 22:01:28 +0100 |

Let`s try the exponential distribution... *********** sysuse auto, clear cap ssc inst rnd rndexp `c(N)' 3 g weightstoc= weight+100*xe ***********

HTH Martin _______________________

To: <statalist@hsphsun2.harvard.edu> Sent: Monday, November 10, 2008 9:35 PM Subject: RE: st: RE: Manipulation of the distribution

Hi again1) In your car-example below, what about adding a stochastic element withanother probability distribution? Is that straight-forward as well?2) Will using the drawnorm-command in stata serve the same purpose (afteradding the "draws" to the old weight) of adding a stochastic element asthe trick using invnorm(uniform())?Linn -----Opprinnelig melding-----Fra: owner-statalist@hsphsun2.harvard.edu[mailto:owner-statalist@hsphsun2.harvard.edu] På vegne av Martin WeissSendt: 10. november 2008 17:54 Til: statalist@hsphsun2.harvard.edu Emne: RE: st: RE: Manipulation of the distribution Although I did not use it in my own example... HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Linn RenéeNaperSent: Monday, November 10, 2008 5:45 PM To: statalist@hsphsun2.harvard.edu Subject: RE: st: RE: Manipulation of the distribution Thanks Martin, Your simple "nutshell" explanation helped! -----Opprinnelig melding----- Fra: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] På vegne av Martin Weiss Sendt: 10. november 2008 16:27 Til: statalist@hsphsun2.harvard.edu Emne: RE: st: RE: Manipulation of the distribution For the -set seed- issue, see, e.g. -help generate-. It allows you, to putit in a nutshell, to reproduce your research later on even though there isa"stochastic element" in it. If I want to add such an element to the weight of very old cars under Stata 10.0, and hopefully 9.x, I go ******** sysuse auto, clear g weightstoc= weight+100*invnormal(uniform()) *let`s see... tw (scatter weight weightstoc) ( function y=x, range(0 5000)) ******** HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Linn RenéeNaperSent: Monday, November 10, 2008 4:06 PM To: statalist@hsphsun2.harvard.edu Subject: RE: st: RE: Manipulation of the distribution Thanks I don't know what happened to the formatting (sending from ahotmail-account, a meant to send in plain text-format). I'm trying onesmoreusing a another email-account...Maybe, I can reformulate my problem a little. What I actually are tryingtodo is to manipulate hourly electricity prices by adding a stochasticelement. Like "price + u". The element u should have a givendistribution -so that's way I need to generate a new variable with a given mean and standard deviation. Therefor I am trying to learn more one how Stata actually define new random variables. What does the "set seed" option in invnorm actually do? Next, I will add this element to the price at random. The prices can be grouped in different ways, by day, week etc. I aim at doing differentmanipulations, for example increasing the sd of the daily prices by agivenfactor, but let it be random which prices are decreased and increased. I could also let it be random how large the daily increase is for different weeks. Important here is thus that all prices are identified by weekday, weeknumber and year. Is there a good way to imply a new "shape" to an already excistingdistribution of prices. For example if you have a prices with kerneldensitywith "one peak", and you like to change the distribution so that is has"twopeaks". Hard to figure out your email in my Outlook (weird formatting, of the code in particular). You want to look at -ssc d rnd- -h sample-the former because you run Stata9: Stata 10.1 now comes with built-inrandomnumber functionality.BTW, -ret list- is very much unnecessary in a loop. This command justservesto acquaint you with the return list, but is of no use in the loop... HTH Martin * * 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/

**References**:**RE: st: RE: Manipulation of the distribution***From:*Linn Renée Naper <linn.naper@ecgroup.no>

**RE: st: RE: Manipulation of the distribution***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**RE: st: RE: Manipulation of the distribution***From:*Linn Renée Naper <linn.naper@ecgroup.no>

**RE: st: RE: Manipulation of the distribution***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**RE: st: RE: Manipulation of the distribution***From:*Linn Renée Naper <linn.naper@ecgroup.no>

- Prev by Date:
**RE: st: Stata not recommended for exact 2x2 test** - Next by Date:
**Re: st: Qs-mata run-time error** - Previous by thread:
**RE: st: RE: Manipulation of the distribution** - Next by thread:
**st: problems with xtivreg2 command** - Index(es):

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