Hello everyone,

I am wondering how to simply merge two GRanges objects by range field and add the value by additional vector. For example, I have two objects below 
 
obj1 

seqnames           ranges strand |       Val
            <Rle>        <IRanges>  <Rle> | <integer>
  [1] chr1_random [272531, 272571]      + |        88
  [2] chr1_random [272871, 272911]      + |        45

obj2
 seqnames           ranges strand |       Val
            <Rle>        <IRanges>  <Rle> | <integer>
  [1] chr1_random [272531, 272581]      + |        800
  [2] chr1_random [272850, 272911]      + |        450

after merged, it should be an object as the following mergedObject and it would concern the differences in IRANGE data (e.g. 581 and 850 in obj2 above were different from those of obj1, which were 571 and 871 respectively)

mergedObject

 seqnames           ranges strand                 |         object2Val   object1Val
            <Rle>        <IRanges>  <Rle>         |         <integer>     <integer>
  [1] chr1_random [272531, 272581]      + |        800               88
  [2] chr1_random [272850, 272911]      + |        450               45





On Wednesday, October 16, 2013 8:31 AM, Terry Therneau <therneau@mayo.edu> wrote:
 


On 10/16/2013 05:00 AM, r-help-request@r-project.org wrote:
> Hello,
>
> I'm trying to use coxph() function to fit a very simple Cox proportional
> hazards regression model (only one covariate) but the parameter space is
> restricted to an open set (0, 1). Can I still obtain a valid estimate by
> using coxph function in this scenario? If yes, how? Any suggestion would be
> greatly appreciated. Thanks!!!

Easily:
    1.  Fit the unrestricted model.  If the solution is in 0-1 you are done.
    2.  If it is outside, fix the coefficient.  Say that the solution is 1.73, then the
optimal solution under contraint is 1.
        Redo the fit adding the paramters  "init=1, iter=0".  This forces the program to 
give the loglik and etc for the fixed coefficient of 1.0.

Terry Therneau

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
	[[alternative HTML version deleted]]

