Hi,
 
  I'm interested in performing a regression of dependent variable y on
independent variable x, where (x,y) are known only for y < c, where c
is
a constant.  For y >= c, neither x or y are known.  This is called a
truncated regression, I believe.
 
  I read a post on the R help list, that recommended doing the
following:
 
  "The form for the response is Surv(c,y,1), but it doesn't recycle
arguments
so you actually need Surv(rep(c,length(y)),y,rep(1,length(y)))"
 
  I have tried to follow the above procedure, but I obtain the error
message
 
  " Stop time must be > start time"
 
which I don't understand.  I think that at least part of the problem
is
that its hard to know what "Surv(c,y,1)" means, i.e, what quantity in
the input list to Surv is supposed to be set equal to c, to y, etc. 
There also may be other parameters I've not set correctly. The code
that
actually performs the regression is below:
 
"trunc <- survreg(Surv(c,yx[,2],event=rep(1,length(yx[,2]))) ~ yx[,1],
dist='gaussian', data=yxfr)" , where c is already defined as
c<-rep(200,npoints), where npoints is the number of (x,y) data pairs.
 
  I should mention that I have R v1.8.1, and to perform these
calculations I've invoked librarys MASS and SURVIVAL.  I have tried to
look this up in the manuals, but so far I've not found anything on
truncated regression.
 
  If you could tell me what my error(s) is(are), and/or a detailed
description of how to perform truncated regression, that would be
great.
 
  Thanks,
 
  Howard Alper


        [[alternative HTML version deleted]]

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to