Skip to content

truncated observed

3 messages · Troels Ring, Brian Ripley, Thomas Lumley

#
Dear friends.
I believe this problem has been discussed in various forms now and then, so 
I hope you will forgive me I ask how to do a truncated model like this, 
where the observed y is recorded as 10 whenever it is higher or equal to 
that value

x <- rnorm(1000)
y <- 10*x + rnorm(1000)
y[which(y>10)] <- 10
and recover the "true" model ?


Best wishes
Troels


Troels Ring, MD
Department of Nephrology
Aalborg Hospital, Denmark
tring at gvdnet.dk
fax 00 45 99 32 22 34
tlf 00 45 99 32 22 42
    00 45 98 14 05 82 (home)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20020426/a72d3ed5/attachment.html
#
On Fri, 26 Apr 2002, Troels Ring wrote:

            
That's more commonly known as censored not truncated.  (In a truncated
model the observations larger than 10 are lost.)

In your specific case I believe you can fit the model by survreg in
package survival.  Something like

survreg(Surv(y, y < 10) ~ x, dist="gaussian")

In general you need to write a likelihood function and optimize it, e.g.
with optim, or make use of the ability to add your own distributions to
survreg.
#
On Fri, 26 Apr 2002 ripley at stats.ox.ac.uk wrote:

            
The ability to add your own distributions to survreg() doesn't actually
work. It will work with the new version of "survival" coming out with
R1.5.0 and as it is now tested in an example it should keep working in the
future.

	-thomas

Thomas Lumley			Asst. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._