[R] generating points over a function, its possible???

Huntsinger, Reid reid_huntsinger at merck.com
Fri Jun 21 21:50:48 CEST 2002


You can use R's random-number generating functions (e.g. rnorm) to generate
a vector of independent "deviations" from the line, and add them to your y
vector. You can scale them to make the variance match your 13.01403, usually
with a parameter to the function, or simply by multiplying by the
appropriate scale factor. You can get dependent deviations in various ways,
e.g., see "filter" in the ts package for autocorrelated or moving-average
structures. Also check the "mvnorm" package.

Reid Huntsinger

-----Original Message-----
From: Ronaldo Reis Jr. [mailto:chrysopa at insecta.ufv.br]
Sent: Friday, June 21, 2002 12:49 PM
To: R-Help
Subject: [R] generating points over a function, its possible???


Hi,
I have a new (for me) situation.
I have a function for one linear model:
y = 9.7909-0.035*x
I have the variance of system
var = 13.01403
Is possible to create a random vector points of Y (simulating the real data)

over this curve using the function and the variance? I need this to a 
discipline.

I have this:

| \
|  \ -> y = 9.7909-0.035*x and var =  13.014
|   \
|    \ 
|     \
|      \
|__________

I need something like this (generate this points):

|* \*
| * \**
|  **\ *
|    *\ ** 
|    * \*
|     * \ *
|       *\
|____________

Thanks for all
Ronaldo
-- 
"It ain't over until it's over."
-- Casey Stengel
--
|   //|\\   [*****************************][*******************]
|| ( õ õ )  [Ronaldo Reis Júnior          ][PentiumIII-600     ]
|     V     [ESALQ/USP-Entomologia, CP-09 ][HD: 30 + 10 Gb     ]
||  / l \   [13418-900 Piracicaba - SP    ][RAM: 128 Mb        ]
|  /(lin)\  [Fone: 19-429-4199 r.229      ][Video: SiS620-8Mb  ]
||/(linux)\ [chrysopa at insecta.ufv.br      ][Modem: Pctel-onboar]
|/ (linux) \[ICQ#: 5692561                ][SO: CL 7.0 (2.2.19)]
||  ( x )   [*****************************][*******************]
||| _/ \_Powered by Conectiva Linux 7.0 D+:) | Lxuser#: 205366


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA) that may be confidential, proprietary copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message.  If you are not the intended recipient, and have received this message in error, please immediately return this by e-mail and then delete it.

==============================================================================

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list