'LazyData' is specified without a 'data' directory
Running examples in 'NPMLENCC-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: TPNPMLE
> ### Title: Penalized Non-Parametric Maximum-Likelihood Estimation (PNPMLEs)
> ###   for Cohort Samplings with Time Matching under Cox's Regression Model
> ### Aliases: TPNPMLE
> 
> ### ** Examples
> 
> set.seed(100)
> library(splines)
> library(survival)
> library(MASS)
> beta=c(1,0)
> lambda=0.3
> cohort=100
> covariate=2+length(beta)
> z=matrix(rnorm(cohort*length(beta)),nrow=cohort)
> rate=1/(runif(cohort,1,3)*exp(z%*%beta))
> c=rexp(cohort,rate)
> u=-log(runif(cohort,0,1))/(lambda*exp(z%*%beta))
> time=apply(cbind(u,c),1,min)
> status=(u<=c)+0
> casenum=sum(status)
> odata=cbind(time,status,z)
> odata=data.frame(odata)
> a=order(status)
> data=matrix(0,cohort,covariate)
> data=data.frame(data)
> for (i in 1:cohort){
+ data[i,]=odata[a[cohort-i+1],]
+ }
> ncc=matrix(0,cohort,covariate)
> ncc=data.frame(data)
> aa=order(data[1:casenum,1])
> for (i in 1:casenum){
+ ncc[i,]=data[aa[i],]
+ }
> control=1
> q=matrix(0,casenum,control)
> for (i in 1:casenum){
+ k=c(1:cohort)
+ k=k[-(1:i)]
+ sumsc=sum(ncc[i,1]<ncc[,1][(i+1):cohort])
+ if (sumsc==0) {
+ 			q[i,]=c(1)
+ } else {
+ 			q[i,]=sample(k[ncc[i,1]<ncc[,1][(i+1):cohort]],control)
+ }
+ }
> cacon=c(q,1:casenum)
> k=c(1:cohort)
> owf=k[-cacon]
> wt=k[-owf]
> owt=k[-wt]
> ncct=matrix(0,cohort,covariate)
> ncct=data.frame(ncct)
> for (i in 1:length(wt)){
+ ncct[i,]=ncc[wt[i],]
+ }
> for (i in 1:length(owt)){
+ ncct[length(wt)+i,]=ncc[owt[i],]
+ }
> d=length(wt)+1
> ncct[d:cohort,3:covariate]=-9
> TPNPMLEtest=TPNPMLE(ncct,100,30,0,"SCAD",seq(0.10,0.13,0.005),2,1e-05,1)
Error in matrix(c(nccnpmle$npmle), numbeta, 1) : 
  data length differs from size of matrix: [6 != 2 x 1]
Calls: TPNPMLE -> matrix
Execution halted
'LazyData' is specified without a 'data' directory
Running examples in ‘NPMLENCC-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: TPNPMLE
> ### Title: Penalized Non-Parametric Maximum-Likelihood Estimation (PNPMLEs)
> ###   for Cohort Samplings with Time Matching under Cox's Regression Model
> ### Aliases: TPNPMLE
> 
> ### ** Examples
> 
> set.seed(100)
> library(splines)
> library(survival)
> library(MASS)
> beta=c(1,0)
> lambda=0.3
> cohort=100
> covariate=2+length(beta)
> z=matrix(rnorm(cohort*length(beta)),nrow=cohort)
> rate=1/(runif(cohort,1,3)*exp(z%*%beta))
> c=rexp(cohort,rate)
> u=-log(runif(cohort,0,1))/(lambda*exp(z%*%beta))
> time=apply(cbind(u,c),1,min)
> status=(u<=c)+0
> casenum=sum(status)
> odata=cbind(time,status,z)
> odata=data.frame(odata)
> a=order(status)
> data=matrix(0,cohort,covariate)
> data=data.frame(data)
> for (i in 1:cohort){
+ data[i,]=odata[a[cohort-i+1],]
+ }
> ncc=matrix(0,cohort,covariate)
> ncc=data.frame(data)
> aa=order(data[1:casenum,1])
> for (i in 1:casenum){
+ ncc[i,]=data[aa[i],]
+ }
> control=1
> q=matrix(0,casenum,control)
> for (i in 1:casenum){
+ k=c(1:cohort)
+ k=k[-(1:i)]
+ sumsc=sum(ncc[i,1]<ncc[,1][(i+1):cohort])
+ if (sumsc==0) {
+ 			q[i,]=c(1)
+ } else {
+ 			q[i,]=sample(k[ncc[i,1]<ncc[,1][(i+1):cohort]],control)
+ }
+ }
> cacon=c(q,1:casenum)
> k=c(1:cohort)
> owf=k[-cacon]
> wt=k[-owf]
> owt=k[-wt]
> ncct=matrix(0,cohort,covariate)
> ncct=data.frame(ncct)
> for (i in 1:length(wt)){
+ ncct[i,]=ncc[wt[i],]
+ }
> for (i in 1:length(owt)){
+ ncct[length(wt)+i,]=ncc[owt[i],]
+ }
> d=length(wt)+1
> ncct[d:cohort,3:covariate]=-9
> TPNPMLEtest=TPNPMLE(ncct,100,30,0,"SCAD",seq(0.10,0.13,0.005),2,1e-05,1)
Error in matrix(c(nccnpmle$npmle), numbeta, 1) : 
  data length differs from size of matrix: [6 != 2 x 1]
Calls: TPNPMLE -> matrix
Execution halted
'LazyData' is specified without a 'data' directory
Running examples in ‘NPMLENCC-Ex.R’ failed
The error most likely occurred in:

> ### Name: TPNPMLE
> ### Title: Penalized Non-Parametric Maximum-Likelihood Estimation (PNPMLEs)
> ###   for Cohort Samplings with Time Matching under Cox's Regression Model
> ### Aliases: TPNPMLE
> 
> ### ** Examples
> 
> set.seed(100)
> library(splines)
> library(survival)
> library(MASS)
> beta=c(1,0)
> lambda=0.3
> cohort=100
> covariate=2+length(beta)
> z=matrix(rnorm(cohort*length(beta)),nrow=cohort)
> rate=1/(runif(cohort,1,3)*exp(z%*%beta))
> c=rexp(cohort,rate)
> u=-log(runif(cohort,0,1))/(lambda*exp(z%*%beta))
> time=apply(cbind(u,c),1,min)
> status=(u<=c)+0
> casenum=sum(status)
> odata=cbind(time,status,z)
> odata=data.frame(odata)
> a=order(status)
> data=matrix(0,cohort,covariate)
> data=data.frame(data)
> for (i in 1:cohort){
+ data[i,]=odata[a[cohort-i+1],]
+ }
> ncc=matrix(0,cohort,covariate)
> ncc=data.frame(data)
> aa=order(data[1:casenum,1])
> for (i in 1:casenum){
+ ncc[i,]=data[aa[i],]
+ }
> control=1
> q=matrix(0,casenum,control)
> for (i in 1:casenum){
+ k=c(1:cohort)
+ k=k[-(1:i)]
+ sumsc=sum(ncc[i,1]<ncc[,1][(i+1):cohort])
+ if (sumsc==0) {
+ 			q[i,]=c(1)
+ } else {
+ 			q[i,]=sample(k[ncc[i,1]<ncc[,1][(i+1):cohort]],control)
+ }
+ }
> cacon=c(q,1:casenum)
> k=c(1:cohort)
> owf=k[-cacon]
> wt=k[-owf]
> owt=k[-wt]
> ncct=matrix(0,cohort,covariate)
> ncct=data.frame(ncct)
> for (i in 1:length(wt)){
+ ncct[i,]=ncc[wt[i],]
+ }
> for (i in 1:length(owt)){
+ ncct[length(wt)+i,]=ncc[owt[i],]
+ }
> d=length(wt)+1
> ncct[d:cohort,3:covariate]=-9
> TPNPMLEtest=TPNPMLE(ncct,100,30,0,"SCAD",seq(0.10,0.13,0.005),2,1e-05,1)
Error in matrix(c(nccnpmle$npmle), numbeta, 1) : 
  data length differs from size of matrix: [6 != 2 x 1]
Calls: TPNPMLE -> matrix
Execution halted
'LazyData' is specified without a 'data' directory
Running examples in ‘NPMLENCC-Ex.R’ failed
The error most likely occurred in:

> ### Name: TPNPMLE
> ### Title: Penalized Non-Parametric Maximum-Likelihood Estimation (PNPMLEs)
> ###   for Cohort Samplings with Time Matching under Cox's Regression Model
> ### Aliases: TPNPMLE
> 
> ### ** Examples
> 
> set.seed(100)
> library(splines)
> library(survival)
> library(MASS)
> beta=c(1,0)
> lambda=0.3
> cohort=100
> covariate=2+length(beta)
> z=matrix(rnorm(cohort*length(beta)),nrow=cohort)
> rate=1/(runif(cohort,1,3)*exp(z%*%beta))
> c=rexp(cohort,rate)
> u=-log(runif(cohort,0,1))/(lambda*exp(z%*%beta))
> time=apply(cbind(u,c),1,min)
> status=(u<=c)+0
> casenum=sum(status)
> odata=cbind(time,status,z)
> odata=data.frame(odata)
> a=order(status)
> data=matrix(0,cohort,covariate)
> data=data.frame(data)
> for (i in 1:cohort){
+ data[i,]=odata[a[cohort-i+1],]
+ }
> ncc=matrix(0,cohort,covariate)
> ncc=data.frame(data)
> aa=order(data[1:casenum,1])
> for (i in 1:casenum){
+ ncc[i,]=data[aa[i],]
+ }
> control=1
> q=matrix(0,casenum,control)
> for (i in 1:casenum){
+ k=c(1:cohort)
+ k=k[-(1:i)]
+ sumsc=sum(ncc[i,1]<ncc[,1][(i+1):cohort])
+ if (sumsc==0) {
+ 			q[i,]=c(1)
+ } else {
+ 			q[i,]=sample(k[ncc[i,1]<ncc[,1][(i+1):cohort]],control)
+ }
+ }
> cacon=c(q,1:casenum)
> k=c(1:cohort)
> owf=k[-cacon]
> wt=k[-owf]
> owt=k[-wt]
> ncct=matrix(0,cohort,covariate)
> ncct=data.frame(ncct)
> for (i in 1:length(wt)){
+ ncct[i,]=ncc[wt[i],]
+ }
> for (i in 1:length(owt)){
+ ncct[length(wt)+i,]=ncc[owt[i],]
+ }
> d=length(wt)+1
> ncct[d:cohort,3:covariate]=-9
> TPNPMLEtest=TPNPMLE(ncct,100,30,0,"SCAD",seq(0.10,0.13,0.005),2,1e-05,1)
Error in matrix(c(nccnpmle$npmle), numbeta, 1) : 
  data length differs from size of matrix: [6 != 2 x 1]
Calls: TPNPMLE -> matrix
Execution halted
'LazyData' is specified without a 'data' directory
'LazyData' is specified without a 'data' directory
'LazyData' is specified without a 'data' directory
'LazyData' is specified without a 'data' directory
'LazyData' is specified without a 'data' directory
'LazyData' is specified without a 'data' directory