Hi S users.
I am generating an imaginary data set useing the following function:
y2<-function(n,w,v1,v2,v3,v4)
{
q<-c(1:n)
a<-c(0,cumsum(rexp(n-1)))
x.1<-matrix(0,n/w,w)
for(i in 1:n/w) x.1[i, ]<-sample(1:w,replace=F)
x.2<-t(x.1)
x.3<-as.numeric(x.2 > w/2)
e.1<- cumsum(c(v1,v2,v3,v4))
e.2<-as.vector(outer(a,e.1,"+"))
y<-as.vector(2+3*a+4*e.2+5*x.3)
assign( "df", data.frame(q=q,a=a,x.3=x.3,e.2=e.2,y=y), 0 )
return(df)
}
n-sample size
w-block size
vi-internal observation times in the imaginary study
The function generates
q-patient label
a-external induction time
x.3-treatment covariates using block randomisation
e.2-internal observation times
y-responce for ith patient at observation times
I need to estimate the coeficients of the covariates(a,x.3,e.2) using the
maximum likelihood method. I have been told I can use NLMIN in s-plus but
how do I do this?
Note:
y<-as.vector(2+3*a+4*e.2+5*x.3)
so if I use lme it will estimate the coeficients to be 3,4,5. And so I
cannot use lme. Any help will be greatly appreciated.
Thanx in advance
Paul H.
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
|