TABLE OF CONTENTS


fortran/fproflik [ Methods ]

NAME

   fproflik --- compute profile likelihood

FUNCTION

Compute profile likelihood of regression parameters for a single process. See also the R function mkproflik.

SYNOPSIS

159       subroutine fproflik(betahat,index,delta,times,Z,as,Uijmat,d,
160      $ ncovs,nr,ns,m,maxj,lik)

INPUTS

    betahat    regression parameters (length p)
    index      d x 6 matrix of indices i,j,k,r,smin,smax 
    delta      length d vector of event indicators (double)
    times      length d vector of actual time span for each row (double)
    Z          d x ncovs matrix of covariates (as a double row vector)
    as         nr x ns matrix of discretization breakpoints (double) 
    Uijmat     m x maxj matrix of frailty estimates (double row vector)
    d          number of rows of Z
    ncovs      number of covariates
    nr         number of strata
    ns         number of breakpoints
    m          number of clusters
    maxj       largest cluster size

OUTPUTS

    lik        storage for output

SOURCE

162       integer d,ncovs,nr,ns,nk,m,maxj
163       integer index(d,6)
164       double precision betahat(ncovs)
165       double precision delta(d),times(d)
166       double precision Z(d,ncovs)
167       double precision Uijmat(m,maxj)
168       double precision lp,deltat,lik
169       double precision mrs(nr,ns)
170       double precision mrsgr(nr,ns,ncovs)
171       double precision as(nr,ns)
172       integer ind,i,j,k,r,s,smax,smin
173 
174       parameter(icol=1, jcol=2, kcol=3, ircol=4, ismincol=5, ismaxcol=6)
175       
176       call fmkmrs(betahat,index,times,Z,as,Uijmat,d,ncovs,nr,ns,
177      $  m,maxj,mrs,mrsgr,0)
178       
179       lik=0.d0
180       do 100 ind=1,d
181         i=index(ind,icol)
182         j=index(ind,jcol)
183         k=index(ind,kcol)
184         r=index(ind,ircol)
185         smin=index(ind,ismincol)
186         smax=index(ind,ismaxcol)
187         deltat=delta(ind)
188         lp=ddot(ncovs,Z(ind,1),d,betahat,1)
189         lik=lik+deltat*(log(Uijmat(i,j))-log(mrs(r,smax))+lp)
190  100  continue
191       end