R Under development (unstable) (2023-06-26 r84605 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > require("DoseFinding") Loading required package: DoseFinding Loading required package: ggplot2 Loading required package: lattice Loading required package: mvtnorm > ## effect curve estimate for linear type models!! > > ######################################################################## > #### Testing function to generate doses and sample size allocs. > genDFdats <- function(model, argsMod, doses, n, sigma, mu = NULL){ + nD <- length(doses) + dose <- sort(doses) + if (length(n) == 1) n <- rep(n, nD) + dose <- rep(dose, n) + args <- c(list(dose), argsMod) + mu <- do.call(model, args) + data.frame(dose = dose, resp = mu + rnorm(sum(n), sd = sigma)) + } > > getDosSampSiz <- function(){ + # generate dose levels + mD <- runif(1, 0, 1500) + nD <- max(rpois(1, 5), 4) + p <- rgamma(nD, 3) + p <- cumsum(p/sum(p)) + doses <- signif(c(0, mD*p), 3) + + # sample size allocations + totSS <- rpois(1, rexp(1, 1/250)) + totSS <- max(totSS, 50) + p <- rgamma(nD+1, 3);p <- p/sum(p) + n <- round(p*totSS) + n[n==0] <- rpois(sum(n==0), 1)+1 + list(doses=doses, n=n) + } > > getDFdataSet <- function(doses, n){ + if(missing(doses) & missing(n)){ + ll <- getDosSampSiz() + } else { + ll <- list(doses = doses, n=n) + } + + e0 <- rnorm(1, 0, 10) + eMax <- rgamma(1, abs(e0)*0.5, 0.5) + sig <- eMax/runif(1, 0.5, 5) + if(runif(1)<0.3){ + aa <- genDFdats("betaMod", c(e0 = e0, eMax = eMax, delta1=runif(1, 0.5, 4), + delta2=runif(1, 0.5, 4), scal=1.2*max(ll$doses)), + ll$doses, ll$n, sig) + } else { + aa <- genDFdats("sigEmax", c(e0 = e0, eMax = eMax, + ed50=runif(1, 0.05*max(ll$doses), 1.5*max(ll$doses)), + h=runif(1, 0.5, 4)), ll$doses, ll$n, sig) + } + N <- sum(ll$n) + center <- c("blue", "green", "red", "yellow", "silver") + aa <- data.frame(x= aa$dose, y=aa$resp, center=as.factor(sample(center, N, replace = T)), + age=runif(N, 1, 100)) + aa[sample(1:nrow(aa)),] + } > > ######################################################################## > ######################################################################## > #### Generate data sets and compare results of fitDRModel > #### to the result of nls and lm for AIC function (if these are consistent > #### parameter estimates, residual sum of square and degrees of freedom are > #### consistent) and the vcov function (if these are consistent parameter > #### estimates, RSS, df and gradient are consistent) > ######################################################################## > > ######################################################################## > #### beta Model > set.seed(2000) > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > bnds <- matrix(c(0.05, 0.05, 6, 6), nrow=2) > fit0 <- fitMod(x, y, datset, model = "betaMod", addCovars = ~1, + addArgs=list(scal=1.2*max(datset$x)), bnds=bnds, start=c(0.6, 0.6)) > fitnls <- nls(y~betaMod(x, e0, emax, delta1, delta2, 1.2*max(datset$x)), + start=c(e0=15, emax=14, delta1=0.8, delta2=0.5), data=datset) > AIC(fit0) [1] 3714.641 > AIC(fitnls) [1] 3714.641 > summary(fit0) Dose Response Model Model: betaMod Fit-type: normal Residuals: Min 1Q Median 3Q Max -23.368 -3.727 0.129 3.894 16.152 Coefficients with approx. stand. error: Estimate Std. Error e0 10.80 0.565 eMax 7.41 0.692 delta1 2.24 0.589 delta2 1.00 0.328 Residual standard error: 5.64 Degrees of freedom: 585 > summary(fitnls) Formula: y ~ betaMod(x, e0, emax, delta1, delta2, 1.2 * max(datset$x)) Parameters: Estimate Std. Error t value Pr(>|t|) e0 10.7964 0.5653 19.098 < 2e-16 *** emax 7.4106 0.6917 10.714 < 2e-16 *** delta1 2.2357 0.5885 3.799 0.000161 *** delta2 1.0047 0.3277 3.066 0.002271 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.637 on 585 degrees of freedom Number of iterations to convergence: 6 Achieved convergence tolerance: 4.028e-06 > > vcov(fit0) e0 eMax delta1 delta2 e0 0.31958673 -0.28252697 0.20809234 0.09247897 eMax -0.28252697 0.47843297 -0.04177476 0.01244179 delta1 0.20809234 -0.04177476 0.34639417 0.18051781 delta2 0.09247897 0.01244179 0.18051781 0.10741016 > vcov(fitnls) e0 emax delta1 delta2 e0 0.31959066 -0.28253052 0.20808969 0.09247786 emax -0.28253052 0.47843381 -0.04177516 0.01244118 delta1 0.20808969 -0.04177516 0.34638195 0.18051234 delta2 0.09247786 0.01244118 0.18051234 0.10740756 > > predict(fit0, predType="effect-curve", se.fit=TRUE) $fit [1] 6.0578751 6.8058158 7.2227652 6.0578751 3.1444084 6.8058158 7.2227652 [8] 3.1444084 6.0578751 0.0000000 6.0578751 6.0578751 7.2227652 3.1444084 [15] 0.8440180 0.0000000 6.0578751 3.1444084 3.1444084 0.0000000 7.2227652 [22] 0.0000000 7.2227652 6.8058158 6.8058158 3.1444084 6.8058158 6.8058158 [29] 3.1444084 6.0578751 7.2227652 6.8058158 3.1444084 3.1444084 3.1444084 [36] 0.0000000 0.0000000 3.1444084 6.8058158 3.1444084 3.1444084 0.8440180 [43] 3.1444084 6.0578751 3.1444084 6.0578751 0.8440180 7.2227652 0.8440180 [50] 0.8440180 0.0000000 7.2227652 6.8058158 6.8058158 7.2227652 3.1444084 [57] 7.2227652 6.8058158 0.8440180 0.8440180 3.1444084 0.0000000 7.2227652 [64] 6.8058158 6.8058158 6.8058158 0.0000000 7.2227652 3.1444084 6.0578751 [71] 0.0000000 0.8440180 0.8440180 6.8058158 3.1444084 3.1444084 6.0578751 [78] 0.0000000 6.0578751 6.8058158 6.8058158 3.1444084 3.1444084 3.1444084 [85] 3.1444084 7.2227652 6.8058158 0.8440180 0.0000000 0.8440180 7.2227652 [92] 6.8058158 3.1444084 7.2227652 6.0578751 6.8058158 6.0578751 6.8058158 [99] 6.8058158 6.8058158 3.1444084 6.0578751 6.8058158 0.0000000 6.0578751 [106] 6.8058158 0.0000000 6.8058158 3.1444084 3.1444084 0.8440180 6.8058158 [113] 6.0578751 3.1444084 0.1731496 6.0578751 6.0578751 0.0000000 6.8058158 [120] 0.0000000 0.0000000 6.8058158 0.1731496 0.8440180 0.0000000 6.0578751 [127] 6.8058158 3.1444084 6.0578751 0.8440180 6.8058158 0.8440180 7.2227652 [134] 6.8058158 3.1444084 6.0578751 6.8058158 7.2227652 6.8058158 0.1731496 [141] 6.8058158 6.8058158 0.8440180 6.8058158 6.0578751 7.2227652 6.8058158 [148] 3.1444084 3.1444084 0.0000000 6.0578751 3.1444084 0.0000000 3.1444084 [155] 6.8058158 7.2227652 6.8058158 0.0000000 0.0000000 0.8440180 3.1444084 [162] 0.0000000 0.1731496 3.1444084 3.1444084 6.0578751 0.0000000 0.8440180 [169] 0.0000000 3.1444084 3.1444084 6.0578751 6.0578751 0.0000000 7.2227652 [176] 0.8440180 0.0000000 6.0578751 0.0000000 7.2227652 0.0000000 3.1444084 [183] 6.0578751 6.0578751 3.1444084 3.1444084 0.1731496 7.2227652 3.1444084 [190] 0.8440180 7.2227652 7.2227652 0.8440180 0.0000000 7.2227652 3.1444084 [197] 7.2227652 7.2227652 0.1731496 3.1444084 0.0000000 7.2227652 3.1444084 [204] 6.8058158 6.8058158 7.2227652 6.8058158 7.2227652 0.8440180 6.0578751 [211] 3.1444084 3.1444084 3.1444084 0.0000000 0.0000000 6.0578751 6.0578751 [218] 3.1444084 3.1444084 0.1731496 7.2227652 7.2227652 0.0000000 0.8440180 [225] 7.2227652 0.8440180 3.1444084 0.8440180 0.0000000 7.2227652 3.1444084 [232] 6.8058158 6.8058158 3.1444084 0.8440180 6.0578751 0.8440180 0.0000000 [239] 0.0000000 6.8058158 7.2227652 6.8058158 6.0578751 3.1444084 7.2227652 [246] 6.8058158 3.1444084 7.2227652 0.8440180 0.8440180 7.2227652 6.0578751 [253] 0.1731496 7.2227652 6.8058158 6.8058158 7.2227652 6.8058158 6.0578751 [260] 6.8058158 0.8440180 6.8058158 6.8058158 7.2227652 6.0578751 0.8440180 [267] 6.8058158 3.1444084 3.1444084 0.8440180 3.1444084 0.8440180 0.0000000 [274] 3.1444084 0.8440180 0.8440180 0.1731496 6.0578751 6.0578751 0.8440180 [281] 0.0000000 0.0000000 0.0000000 6.0578751 0.0000000 3.1444084 3.1444084 [288] 0.0000000 0.8440180 6.0578751 0.0000000 6.0578751 7.2227652 0.8440180 [295] 7.2227652 6.8058158 0.8440180 0.1731496 7.2227652 7.2227652 0.0000000 [302] 6.0578751 6.8058158 7.2227652 0.0000000 6.0578751 6.0578751 6.8058158 [309] 0.0000000 0.8440180 6.0578751 6.8058158 6.8058158 3.1444084 0.8440180 [316] 6.8058158 3.1444084 7.2227652 6.0578751 0.8440180 3.1444084 0.8440180 [323] 7.2227652 6.0578751 6.0578751 7.2227652 3.1444084 6.0578751 6.8058158 [330] 0.8440180 0.8440180 6.8058158 6.8058158 7.2227652 0.8440180 3.1444084 [337] 3.1444084 6.0578751 6.0578751 0.0000000 3.1444084 6.8058158 0.8440180 [344] 3.1444084 6.0578751 7.2227652 3.1444084 3.1444084 0.1731496 6.0578751 [351] 7.2227652 7.2227652 3.1444084 6.0578751 3.1444084 6.0578751 3.1444084 [358] 6.0578751 3.1444084 7.2227652 0.8440180 3.1444084 6.8058158 0.8440180 [365] 3.1444084 0.1731496 6.8058158 3.1444084 6.8058158 7.2227652 3.1444084 [372] 6.8058158 6.8058158 3.1444084 0.0000000 0.8440180 0.8440180 6.8058158 [379] 0.0000000 7.2227652 0.8440180 0.8440180 6.0578751 3.1444084 0.8440180 [386] 7.2227652 3.1444084 7.2227652 6.8058158 3.1444084 3.1444084 6.8058158 [393] 6.0578751 3.1444084 6.8058158 0.0000000 6.8058158 0.8440180 0.0000000 [400] 3.1444084 6.8058158 0.8440180 6.0578751 6.0578751 0.1731496 6.0578751 [407] 0.8440180 3.1444084 0.8440180 3.1444084 3.1444084 6.8058158 0.8440180 [414] 6.8058158 7.2227652 0.0000000 6.8058158 0.8440180 0.0000000 7.2227652 [421] 6.8058158 3.1444084 3.1444084 6.8058158 6.8058158 6.0578751 6.0578751 [428] 6.0578751 7.2227652 0.1731496 7.2227652 6.8058158 0.0000000 3.1444084 [435] 7.2227652 6.8058158 6.8058158 0.8440180 0.0000000 3.1444084 7.2227652 [442] 6.8058158 6.0578751 3.1444084 6.0578751 7.2227652 6.0578751 7.2227652 [449] 0.0000000 7.2227652 7.2227652 0.8440180 6.0578751 6.8058158 0.0000000 [456] 0.8440180 6.0578751 0.1731496 3.1444084 7.2227652 7.2227652 6.0578751 [463] 6.0578751 3.1444084 0.1731496 7.2227652 6.8058158 0.8440180 0.0000000 [470] 0.8440180 6.8058158 6.8058158 7.2227652 6.0578751 7.2227652 0.8440180 [477] 3.1444084 7.2227652 7.2227652 0.1731496 3.1444084 7.2227652 7.2227652 [484] 3.1444084 6.8058158 0.0000000 7.2227652 6.0578751 0.8440180 3.1444084 [491] 7.2227652 7.2227652 6.0578751 3.1444084 7.2227652 6.0578751 0.0000000 [498] 0.8440180 6.0578751 6.8058158 3.1444084 6.0578751 0.0000000 7.2227652 [505] 3.1444084 0.0000000 0.8440180 7.2227652 6.8058158 6.8058158 3.1444084 [512] 6.8058158 0.1731496 0.0000000 3.1444084 3.1444084 3.1444084 6.8058158 [519] 6.8058158 0.0000000 6.8058158 6.8058158 3.1444084 7.2227652 3.1444084 [526] 0.8440180 0.8440180 7.2227652 6.0578751 6.0578751 3.1444084 6.8058158 [533] 7.2227652 6.0578751 6.8058158 3.1444084 3.1444084 3.1444084 7.2227652 [540] 0.0000000 0.0000000 6.8058158 3.1444084 0.1731496 0.0000000 6.0578751 [547] 7.2227652 6.0578751 6.0578751 7.2227652 6.0578751 6.0578751 6.8058158 [554] 0.0000000 0.0000000 3.1444084 6.0578751 7.2227652 7.2227652 3.1444084 [561] 3.1444084 6.8058158 7.2227652 6.8058158 6.8058158 0.0000000 6.8058158 [568] 3.1444084 7.2227652 0.8440180 0.0000000 3.1444084 0.8440180 6.8058158 [575] 7.2227652 3.1444084 6.0578751 0.8440180 6.8058158 3.1444084 0.0000000 [582] 7.2227652 6.8058158 0.8440180 6.0578751 3.1444084 6.8058158 0.8440180 [589] 6.0578751 $se.fit [1] 0.7643614 0.6580335 0.7488551 0.7643614 0.7997224 0.6580335 0.7488551 [8] 0.7997224 0.7643614 0.0000000 0.7643614 0.7643614 0.7488551 0.7997224 [15] 0.4790120 0.0000000 0.7643614 0.7997224 0.7997224 0.0000000 0.7488551 [22] 0.0000000 0.7488551 0.6580335 0.6580335 0.7997224 0.6580335 0.6580335 [29] 0.7997224 0.7643614 0.7488551 0.6580335 0.7997224 0.7997224 0.7997224 [36] 0.0000000 0.0000000 0.7997224 0.6580335 0.7997224 0.7997224 0.4790120 [43] 0.7997224 0.7643614 0.7997224 0.7643614 0.4790120 0.7488551 0.4790120 [50] 0.4790120 0.0000000 0.7488551 0.6580335 0.6580335 0.7488551 0.7997224 [57] 0.7488551 0.6580335 0.4790120 0.4790120 0.7997224 0.0000000 0.7488551 [64] 0.6580335 0.6580335 0.6580335 0.0000000 0.7488551 0.7997224 0.7643614 [71] 0.0000000 0.4790120 0.4790120 0.6580335 0.7997224 0.7997224 0.7643614 [78] 0.0000000 0.7643614 0.6580335 0.6580335 0.7997224 0.7997224 0.7997224 [85] 0.7997224 0.7488551 0.6580335 0.4790120 0.0000000 0.4790120 0.7488551 [92] 0.6580335 0.7997224 0.7488551 0.7643614 0.6580335 0.7643614 0.6580335 [99] 0.6580335 0.6580335 0.7997224 0.7643614 0.6580335 0.0000000 0.7643614 [106] 0.6580335 0.0000000 0.6580335 0.7997224 0.7997224 0.4790120 0.6580335 [113] 0.7643614 0.7997224 0.1680259 0.7643614 0.7643614 0.0000000 0.6580335 [120] 0.0000000 0.0000000 0.6580335 0.1680259 0.4790120 0.0000000 0.7643614 [127] 0.6580335 0.7997224 0.7643614 0.4790120 0.6580335 0.4790120 0.7488551 [134] 0.6580335 0.7997224 0.7643614 0.6580335 0.7488551 0.6580335 0.1680259 [141] 0.6580335 0.6580335 0.4790120 0.6580335 0.7643614 0.7488551 0.6580335 [148] 0.7997224 0.7997224 0.0000000 0.7643614 0.7997224 0.0000000 0.7997224 [155] 0.6580335 0.7488551 0.6580335 0.0000000 0.0000000 0.4790120 0.7997224 [162] 0.0000000 0.1680259 0.7997224 0.7997224 0.7643614 0.0000000 0.4790120 [169] 0.0000000 0.7997224 0.7997224 0.7643614 0.7643614 0.0000000 0.7488551 [176] 0.4790120 0.0000000 0.7643614 0.0000000 0.7488551 0.0000000 0.7997224 [183] 0.7643614 0.7643614 0.7997224 0.7997224 0.1680259 0.7488551 0.7997224 [190] 0.4790120 0.7488551 0.7488551 0.4790120 0.0000000 0.7488551 0.7997224 [197] 0.7488551 0.7488551 0.1680259 0.7997224 0.0000000 0.7488551 0.7997224 [204] 0.6580335 0.6580335 0.7488551 0.6580335 0.7488551 0.4790120 0.7643614 [211] 0.7997224 0.7997224 0.7997224 0.0000000 0.0000000 0.7643614 0.7643614 [218] 0.7997224 0.7997224 0.1680259 0.7488551 0.7488551 0.0000000 0.4790120 [225] 0.7488551 0.4790120 0.7997224 0.4790120 0.0000000 0.7488551 0.7997224 [232] 0.6580335 0.6580335 0.7997224 0.4790120 0.7643614 0.4790120 0.0000000 [239] 0.0000000 0.6580335 0.7488551 0.6580335 0.7643614 0.7997224 0.7488551 [246] 0.6580335 0.7997224 0.7488551 0.4790120 0.4790120 0.7488551 0.7643614 [253] 0.1680259 0.7488551 0.6580335 0.6580335 0.7488551 0.6580335 0.7643614 [260] 0.6580335 0.4790120 0.6580335 0.6580335 0.7488551 0.7643614 0.4790120 [267] 0.6580335 0.7997224 0.7997224 0.4790120 0.7997224 0.4790120 0.0000000 [274] 0.7997224 0.4790120 0.4790120 0.1680259 0.7643614 0.7643614 0.4790120 [281] 0.0000000 0.0000000 0.0000000 0.7643614 0.0000000 0.7997224 0.7997224 [288] 0.0000000 0.4790120 0.7643614 0.0000000 0.7643614 0.7488551 0.4790120 [295] 0.7488551 0.6580335 0.4790120 0.1680259 0.7488551 0.7488551 0.0000000 [302] 0.7643614 0.6580335 0.7488551 0.0000000 0.7643614 0.7643614 0.6580335 [309] 0.0000000 0.4790120 0.7643614 0.6580335 0.6580335 0.7997224 0.4790120 [316] 0.6580335 0.7997224 0.7488551 0.7643614 0.4790120 0.7997224 0.4790120 [323] 0.7488551 0.7643614 0.7643614 0.7488551 0.7997224 0.7643614 0.6580335 [330] 0.4790120 0.4790120 0.6580335 0.6580335 0.7488551 0.4790120 0.7997224 [337] 0.7997224 0.7643614 0.7643614 0.0000000 0.7997224 0.6580335 0.4790120 [344] 0.7997224 0.7643614 0.7488551 0.7997224 0.7997224 0.1680259 0.7643614 [351] 0.7488551 0.7488551 0.7997224 0.7643614 0.7997224 0.7643614 0.7997224 [358] 0.7643614 0.7997224 0.7488551 0.4790120 0.7997224 0.6580335 0.4790120 [365] 0.7997224 0.1680259 0.6580335 0.7997224 0.6580335 0.7488551 0.7997224 [372] 0.6580335 0.6580335 0.7997224 0.0000000 0.4790120 0.4790120 0.6580335 [379] 0.0000000 0.7488551 0.4790120 0.4790120 0.7643614 0.7997224 0.4790120 [386] 0.7488551 0.7997224 0.7488551 0.6580335 0.7997224 0.7997224 0.6580335 [393] 0.7643614 0.7997224 0.6580335 0.0000000 0.6580335 0.4790120 0.0000000 [400] 0.7997224 0.6580335 0.4790120 0.7643614 0.7643614 0.1680259 0.7643614 [407] 0.4790120 0.7997224 0.4790120 0.7997224 0.7997224 0.6580335 0.4790120 [414] 0.6580335 0.7488551 0.0000000 0.6580335 0.4790120 0.0000000 0.7488551 [421] 0.6580335 0.7997224 0.7997224 0.6580335 0.6580335 0.7643614 0.7643614 [428] 0.7643614 0.7488551 0.1680259 0.7488551 0.6580335 0.0000000 0.7997224 [435] 0.7488551 0.6580335 0.6580335 0.4790120 0.0000000 0.7997224 0.7488551 [442] 0.6580335 0.7643614 0.7997224 0.7643614 0.7488551 0.7643614 0.7488551 [449] 0.0000000 0.7488551 0.7488551 0.4790120 0.7643614 0.6580335 0.0000000 [456] 0.4790120 0.7643614 0.1680259 0.7997224 0.7488551 0.7488551 0.7643614 [463] 0.7643614 0.7997224 0.1680259 0.7488551 0.6580335 0.4790120 0.0000000 [470] 0.4790120 0.6580335 0.6580335 0.7488551 0.7643614 0.7488551 0.4790120 [477] 0.7997224 0.7488551 0.7488551 0.1680259 0.7997224 0.7488551 0.7488551 [484] 0.7997224 0.6580335 0.0000000 0.7488551 0.7643614 0.4790120 0.7997224 [491] 0.7488551 0.7488551 0.7643614 0.7997224 0.7488551 0.7643614 0.0000000 [498] 0.4790120 0.7643614 0.6580335 0.7997224 0.7643614 0.0000000 0.7488551 [505] 0.7997224 0.0000000 0.4790120 0.7488551 0.6580335 0.6580335 0.7997224 [512] 0.6580335 0.1680259 0.0000000 0.7997224 0.7997224 0.7997224 0.6580335 [519] 0.6580335 0.0000000 0.6580335 0.6580335 0.7997224 0.7488551 0.7997224 [526] 0.4790120 0.4790120 0.7488551 0.7643614 0.7643614 0.7997224 0.6580335 [533] 0.7488551 0.7643614 0.6580335 0.7997224 0.7997224 0.7997224 0.7488551 [540] 0.0000000 0.0000000 0.6580335 0.7997224 0.1680259 0.0000000 0.7643614 [547] 0.7488551 0.7643614 0.7643614 0.7488551 0.7643614 0.7643614 0.6580335 [554] 0.0000000 0.0000000 0.7997224 0.7643614 0.7488551 0.7488551 0.7997224 [561] 0.7997224 0.6580335 0.7488551 0.6580335 0.6580335 0.0000000 0.6580335 [568] 0.7997224 0.7488551 0.4790120 0.0000000 0.7997224 0.4790120 0.6580335 [575] 0.7488551 0.7997224 0.7643614 0.4790120 0.6580335 0.7997224 0.0000000 [582] 0.7488551 0.6580335 0.4790120 0.7643614 0.7997224 0.6580335 0.4790120 [589] 0.7643614 > predict(fit0, predType="full-model", se.fit=TRUE) $fit [1] 16.85434 17.60229 18.01923 16.85434 13.94088 17.60229 18.01923 13.94088 [9] 16.85434 10.79647 16.85434 16.85434 18.01923 13.94088 11.64049 10.79647 [17] 16.85434 13.94088 13.94088 10.79647 18.01923 10.79647 18.01923 17.60229 [25] 17.60229 13.94088 17.60229 17.60229 13.94088 16.85434 18.01923 17.60229 [33] 13.94088 13.94088 13.94088 10.79647 10.79647 13.94088 17.60229 13.94088 [41] 13.94088 11.64049 13.94088 16.85434 13.94088 16.85434 11.64049 18.01923 [49] 11.64049 11.64049 10.79647 18.01923 17.60229 17.60229 18.01923 13.94088 [57] 18.01923 17.60229 11.64049 11.64049 13.94088 10.79647 18.01923 17.60229 [65] 17.60229 17.60229 10.79647 18.01923 13.94088 16.85434 10.79647 11.64049 [73] 11.64049 17.60229 13.94088 13.94088 16.85434 10.79647 16.85434 17.60229 [81] 17.60229 13.94088 13.94088 13.94088 13.94088 18.01923 17.60229 11.64049 [89] 10.79647 11.64049 18.01923 17.60229 13.94088 18.01923 16.85434 17.60229 [97] 16.85434 17.60229 17.60229 17.60229 13.94088 16.85434 17.60229 10.79647 [105] 16.85434 17.60229 10.79647 17.60229 13.94088 13.94088 11.64049 17.60229 [113] 16.85434 13.94088 10.96962 16.85434 16.85434 10.79647 17.60229 10.79647 [121] 10.79647 17.60229 10.96962 11.64049 10.79647 16.85434 17.60229 13.94088 [129] 16.85434 11.64049 17.60229 11.64049 18.01923 17.60229 13.94088 16.85434 [137] 17.60229 18.01923 17.60229 10.96962 17.60229 17.60229 11.64049 17.60229 [145] 16.85434 18.01923 17.60229 13.94088 13.94088 10.79647 16.85434 13.94088 [153] 10.79647 13.94088 17.60229 18.01923 17.60229 10.79647 10.79647 11.64049 [161] 13.94088 10.79647 10.96962 13.94088 13.94088 16.85434 10.79647 11.64049 [169] 10.79647 13.94088 13.94088 16.85434 16.85434 10.79647 18.01923 11.64049 [177] 10.79647 16.85434 10.79647 18.01923 10.79647 13.94088 16.85434 16.85434 [185] 13.94088 13.94088 10.96962 18.01923 13.94088 11.64049 18.01923 18.01923 [193] 11.64049 10.79647 18.01923 13.94088 18.01923 18.01923 10.96962 13.94088 [201] 10.79647 18.01923 13.94088 17.60229 17.60229 18.01923 17.60229 18.01923 [209] 11.64049 16.85434 13.94088 13.94088 13.94088 10.79647 10.79647 16.85434 [217] 16.85434 13.94088 13.94088 10.96962 18.01923 18.01923 10.79647 11.64049 [225] 18.01923 11.64049 13.94088 11.64049 10.79647 18.01923 13.94088 17.60229 [233] 17.60229 13.94088 11.64049 16.85434 11.64049 10.79647 10.79647 17.60229 [241] 18.01923 17.60229 16.85434 13.94088 18.01923 17.60229 13.94088 18.01923 [249] 11.64049 11.64049 18.01923 16.85434 10.96962 18.01923 17.60229 17.60229 [257] 18.01923 17.60229 16.85434 17.60229 11.64049 17.60229 17.60229 18.01923 [265] 16.85434 11.64049 17.60229 13.94088 13.94088 11.64049 13.94088 11.64049 [273] 10.79647 13.94088 11.64049 11.64049 10.96962 16.85434 16.85434 11.64049 [281] 10.79647 10.79647 10.79647 16.85434 10.79647 13.94088 13.94088 10.79647 [289] 11.64049 16.85434 10.79647 16.85434 18.01923 11.64049 18.01923 17.60229 [297] 11.64049 10.96962 18.01923 18.01923 10.79647 16.85434 17.60229 18.01923 [305] 10.79647 16.85434 16.85434 17.60229 10.79647 11.64049 16.85434 17.60229 [313] 17.60229 13.94088 11.64049 17.60229 13.94088 18.01923 16.85434 11.64049 [321] 13.94088 11.64049 18.01923 16.85434 16.85434 18.01923 13.94088 16.85434 [329] 17.60229 11.64049 11.64049 17.60229 17.60229 18.01923 11.64049 13.94088 [337] 13.94088 16.85434 16.85434 10.79647 13.94088 17.60229 11.64049 13.94088 [345] 16.85434 18.01923 13.94088 13.94088 10.96962 16.85434 18.01923 18.01923 [353] 13.94088 16.85434 13.94088 16.85434 13.94088 16.85434 13.94088 18.01923 [361] 11.64049 13.94088 17.60229 11.64049 13.94088 10.96962 17.60229 13.94088 [369] 17.60229 18.01923 13.94088 17.60229 17.60229 13.94088 10.79647 11.64049 [377] 11.64049 17.60229 10.79647 18.01923 11.64049 11.64049 16.85434 13.94088 [385] 11.64049 18.01923 13.94088 18.01923 17.60229 13.94088 13.94088 17.60229 [393] 16.85434 13.94088 17.60229 10.79647 17.60229 11.64049 10.79647 13.94088 [401] 17.60229 11.64049 16.85434 16.85434 10.96962 16.85434 11.64049 13.94088 [409] 11.64049 13.94088 13.94088 17.60229 11.64049 17.60229 18.01923 10.79647 [417] 17.60229 11.64049 10.79647 18.01923 17.60229 13.94088 13.94088 17.60229 [425] 17.60229 16.85434 16.85434 16.85434 18.01923 10.96962 18.01923 17.60229 [433] 10.79647 13.94088 18.01923 17.60229 17.60229 11.64049 10.79647 13.94088 [441] 18.01923 17.60229 16.85434 13.94088 16.85434 18.01923 16.85434 18.01923 [449] 10.79647 18.01923 18.01923 11.64049 16.85434 17.60229 10.79647 11.64049 [457] 16.85434 10.96962 13.94088 18.01923 18.01923 16.85434 16.85434 13.94088 [465] 10.96962 18.01923 17.60229 11.64049 10.79647 11.64049 17.60229 17.60229 [473] 18.01923 16.85434 18.01923 11.64049 13.94088 18.01923 18.01923 10.96962 [481] 13.94088 18.01923 18.01923 13.94088 17.60229 10.79647 18.01923 16.85434 [489] 11.64049 13.94088 18.01923 18.01923 16.85434 13.94088 18.01923 16.85434 [497] 10.79647 11.64049 16.85434 17.60229 13.94088 16.85434 10.79647 18.01923 [505] 13.94088 10.79647 11.64049 18.01923 17.60229 17.60229 13.94088 17.60229 [513] 10.96962 10.79647 13.94088 13.94088 13.94088 17.60229 17.60229 10.79647 [521] 17.60229 17.60229 13.94088 18.01923 13.94088 11.64049 11.64049 18.01923 [529] 16.85434 16.85434 13.94088 17.60229 18.01923 16.85434 17.60229 13.94088 [537] 13.94088 13.94088 18.01923 10.79647 10.79647 17.60229 13.94088 10.96962 [545] 10.79647 16.85434 18.01923 16.85434 16.85434 18.01923 16.85434 16.85434 [553] 17.60229 10.79647 10.79647 13.94088 16.85434 18.01923 18.01923 13.94088 [561] 13.94088 17.60229 18.01923 17.60229 17.60229 10.79647 17.60229 13.94088 [569] 18.01923 11.64049 10.79647 13.94088 11.64049 17.60229 18.01923 13.94088 [577] 16.85434 11.64049 17.60229 13.94088 10.79647 18.01923 17.60229 11.64049 [585] 16.85434 13.94088 17.60229 11.64049 16.85434 $se.fit [1] 0.4716508 0.3621952 0.5408090 0.4716508 0.4610877 0.3621952 0.5408090 [8] 0.4610877 0.4716508 0.5653200 0.4716508 0.4716508 0.5408090 0.4610877 [15] 0.3763389 0.5653200 0.4716508 0.4610877 0.4610877 0.5653200 0.5408090 [22] 0.5653200 0.5408090 0.3621952 0.3621952 0.4610877 0.3621952 0.3621952 [29] 0.4610877 0.4716508 0.5408090 0.3621952 0.4610877 0.4610877 0.4610877 [36] 0.5653200 0.5653200 0.4610877 0.3621952 0.4610877 0.4610877 0.3763389 [43] 0.4610877 0.4716508 0.4610877 0.4716508 0.3763389 0.5408090 0.3763389 [50] 0.3763389 0.5653200 0.5408090 0.3621952 0.3621952 0.5408090 0.4610877 [57] 0.5408090 0.3621952 0.3763389 0.3763389 0.4610877 0.5653200 0.5408090 [64] 0.3621952 0.3621952 0.3621952 0.5653200 0.5408090 0.4610877 0.4716508 [71] 0.5653200 0.3763389 0.3763389 0.3621952 0.4610877 0.4610877 0.4716508 [78] 0.5653200 0.4716508 0.3621952 0.3621952 0.4610877 0.4610877 0.4610877 [85] 0.4610877 0.5408090 0.3621952 0.3763389 0.5653200 0.3763389 0.5408090 [92] 0.3621952 0.4610877 0.5408090 0.4716508 0.3621952 0.4716508 0.3621952 [99] 0.3621952 0.3621952 0.4610877 0.4716508 0.3621952 0.5653200 0.4716508 [106] 0.3621952 0.5653200 0.3621952 0.4610877 0.4610877 0.3763389 0.3621952 [113] 0.4716508 0.4610877 0.4616804 0.4716508 0.4716508 0.5653200 0.3621952 [120] 0.5653200 0.5653200 0.3621952 0.4616804 0.3763389 0.5653200 0.4716508 [127] 0.3621952 0.4610877 0.4716508 0.3763389 0.3621952 0.3763389 0.5408090 [134] 0.3621952 0.4610877 0.4716508 0.3621952 0.5408090 0.3621952 0.4616804 [141] 0.3621952 0.3621952 0.3763389 0.3621952 0.4716508 0.5408090 0.3621952 [148] 0.4610877 0.4610877 0.5653200 0.4716508 0.4610877 0.5653200 0.4610877 [155] 0.3621952 0.5408090 0.3621952 0.5653200 0.5653200 0.3763389 0.4610877 [162] 0.5653200 0.4616804 0.4610877 0.4610877 0.4716508 0.5653200 0.3763389 [169] 0.5653200 0.4610877 0.4610877 0.4716508 0.4716508 0.5653200 0.5408090 [176] 0.3763389 0.5653200 0.4716508 0.5653200 0.5408090 0.5653200 0.4610877 [183] 0.4716508 0.4716508 0.4610877 0.4610877 0.4616804 0.5408090 0.4610877 [190] 0.3763389 0.5408090 0.5408090 0.3763389 0.5653200 0.5408090 0.4610877 [197] 0.5408090 0.5408090 0.4616804 0.4610877 0.5653200 0.5408090 0.4610877 [204] 0.3621952 0.3621952 0.5408090 0.3621952 0.5408090 0.3763389 0.4716508 [211] 0.4610877 0.4610877 0.4610877 0.5653200 0.5653200 0.4716508 0.4716508 [218] 0.4610877 0.4610877 0.4616804 0.5408090 0.5408090 0.5653200 0.3763389 [225] 0.5408090 0.3763389 0.4610877 0.3763389 0.5653200 0.5408090 0.4610877 [232] 0.3621952 0.3621952 0.4610877 0.3763389 0.4716508 0.3763389 0.5653200 [239] 0.5653200 0.3621952 0.5408090 0.3621952 0.4716508 0.4610877 0.5408090 [246] 0.3621952 0.4610877 0.5408090 0.3763389 0.3763389 0.5408090 0.4716508 [253] 0.4616804 0.5408090 0.3621952 0.3621952 0.5408090 0.3621952 0.4716508 [260] 0.3621952 0.3763389 0.3621952 0.3621952 0.5408090 0.4716508 0.3763389 [267] 0.3621952 0.4610877 0.4610877 0.3763389 0.4610877 0.3763389 0.5653200 [274] 0.4610877 0.3763389 0.3763389 0.4616804 0.4716508 0.4716508 0.3763389 [281] 0.5653200 0.5653200 0.5653200 0.4716508 0.5653200 0.4610877 0.4610877 [288] 0.5653200 0.3763389 0.4716508 0.5653200 0.4716508 0.5408090 0.3763389 [295] 0.5408090 0.3621952 0.3763389 0.4616804 0.5408090 0.5408090 0.5653200 [302] 0.4716508 0.3621952 0.5408090 0.5653200 0.4716508 0.4716508 0.3621952 [309] 0.5653200 0.3763389 0.4716508 0.3621952 0.3621952 0.4610877 0.3763389 [316] 0.3621952 0.4610877 0.5408090 0.4716508 0.3763389 0.4610877 0.3763389 [323] 0.5408090 0.4716508 0.4716508 0.5408090 0.4610877 0.4716508 0.3621952 [330] 0.3763389 0.3763389 0.3621952 0.3621952 0.5408090 0.3763389 0.4610877 [337] 0.4610877 0.4716508 0.4716508 0.5653200 0.4610877 0.3621952 0.3763389 [344] 0.4610877 0.4716508 0.5408090 0.4610877 0.4610877 0.4616804 0.4716508 [351] 0.5408090 0.5408090 0.4610877 0.4716508 0.4610877 0.4716508 0.4610877 [358] 0.4716508 0.4610877 0.5408090 0.3763389 0.4610877 0.3621952 0.3763389 [365] 0.4610877 0.4616804 0.3621952 0.4610877 0.3621952 0.5408090 0.4610877 [372] 0.3621952 0.3621952 0.4610877 0.5653200 0.3763389 0.3763389 0.3621952 [379] 0.5653200 0.5408090 0.3763389 0.3763389 0.4716508 0.4610877 0.3763389 [386] 0.5408090 0.4610877 0.5408090 0.3621952 0.4610877 0.4610877 0.3621952 [393] 0.4716508 0.4610877 0.3621952 0.5653200 0.3621952 0.3763389 0.5653200 [400] 0.4610877 0.3621952 0.3763389 0.4716508 0.4716508 0.4616804 0.4716508 [407] 0.3763389 0.4610877 0.3763389 0.4610877 0.4610877 0.3621952 0.3763389 [414] 0.3621952 0.5408090 0.5653200 0.3621952 0.3763389 0.5653200 0.5408090 [421] 0.3621952 0.4610877 0.4610877 0.3621952 0.3621952 0.4716508 0.4716508 [428] 0.4716508 0.5408090 0.4616804 0.5408090 0.3621952 0.5653200 0.4610877 [435] 0.5408090 0.3621952 0.3621952 0.3763389 0.5653200 0.4610877 0.5408090 [442] 0.3621952 0.4716508 0.4610877 0.4716508 0.5408090 0.4716508 0.5408090 [449] 0.5653200 0.5408090 0.5408090 0.3763389 0.4716508 0.3621952 0.5653200 [456] 0.3763389 0.4716508 0.4616804 0.4610877 0.5408090 0.5408090 0.4716508 [463] 0.4716508 0.4610877 0.4616804 0.5408090 0.3621952 0.3763389 0.5653200 [470] 0.3763389 0.3621952 0.3621952 0.5408090 0.4716508 0.5408090 0.3763389 [477] 0.4610877 0.5408090 0.5408090 0.4616804 0.4610877 0.5408090 0.5408090 [484] 0.4610877 0.3621952 0.5653200 0.5408090 0.4716508 0.3763389 0.4610877 [491] 0.5408090 0.5408090 0.4716508 0.4610877 0.5408090 0.4716508 0.5653200 [498] 0.3763389 0.4716508 0.3621952 0.4610877 0.4716508 0.5653200 0.5408090 [505] 0.4610877 0.5653200 0.3763389 0.5408090 0.3621952 0.3621952 0.4610877 [512] 0.3621952 0.4616804 0.5653200 0.4610877 0.4610877 0.4610877 0.3621952 [519] 0.3621952 0.5653200 0.3621952 0.3621952 0.4610877 0.5408090 0.4610877 [526] 0.3763389 0.3763389 0.5408090 0.4716508 0.4716508 0.4610877 0.3621952 [533] 0.5408090 0.4716508 0.3621952 0.4610877 0.4610877 0.4610877 0.5408090 [540] 0.5653200 0.5653200 0.3621952 0.4610877 0.4616804 0.5653200 0.4716508 [547] 0.5408090 0.4716508 0.4716508 0.5408090 0.4716508 0.4716508 0.3621952 [554] 0.5653200 0.5653200 0.4610877 0.4716508 0.5408090 0.5408090 0.4610877 [561] 0.4610877 0.3621952 0.5408090 0.3621952 0.3621952 0.5653200 0.3621952 [568] 0.4610877 0.5408090 0.3763389 0.5653200 0.4610877 0.3763389 0.3621952 [575] 0.5408090 0.4610877 0.4716508 0.3763389 0.3621952 0.4610877 0.5653200 [582] 0.5408090 0.3621952 0.3763389 0.4716508 0.4610877 0.3621952 0.3763389 [589] 0.4716508 > > TD(fit0, Delta = 1) [1] 64.48518 > > # with covariates > fit0 <- fitMod(x, y, datset, model="betaMod", addCovars = ~age+center, + addArgs=list(scal=1.2*max(datset$x)), bnds=bnds) > XX <- model.matrix(~center+age, data=datset) > scl <- 1.2*max(datset$x) > fitnls <- nls(y~cbind(XX, betaMod(x, 0, 1, delta1, delta2, scl)), + data=datset, start=c(delta1=1, delta2=0.2), + algorithm = "plinear") > AIC(fit0) [1] 3722.867 > AIC(fitnls) [1] 3722.867 > summary(fit0) Dose Response Model Model: betaMod Fit-type: normal Residuals: Min 1Q Median 3Q Max -23.081 -4.023 0.069 3.767 16.317 Coefficients with approx. stand. error: Estimate Std. Error e0 1.02e+01 0.82024 eMax 7.36e+00 0.69530 delta1 2.25e+00 0.60058 delta2 1.01e+00 0.33271 age 5.72e-04 0.00829 centergreen 7.41e-01 0.73739 centerred 8.30e-01 0.74509 centersilver 7.30e-01 0.70097 centeryellow 6.56e-01 0.73274 Residual standard error: 5.65 Degrees of freedom: 580 > summary(fitnls) Formula: y ~ cbind(XX, betaMod(x, 0, 1, delta1, delta2, scl)) Parameters: Estimate Std. Error t value Pr(>|t|) delta1 2.253e+00 6.006e-01 3.751 0.000194 *** delta2 1.006e+00 3.327e-01 3.025 0.002600 ** .lin.(Intercept) 1.023e+01 8.202e-01 12.470 < 2e-16 *** .lin.centergreen 7.409e-01 7.374e-01 1.005 0.315410 .lin.centerred 8.298e-01 7.451e-01 1.114 0.265866 .lin.centersilver 7.301e-01 7.010e-01 1.042 0.298051 .lin.centeryellow 6.562e-01 7.327e-01 0.896 0.370886 .lin.age 5.723e-04 8.288e-03 0.069 0.944970 .lin7 7.357e+00 6.953e-01 10.581 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.653 on 580 degrees of freedom Number of iterations to convergence: 6 Achieved convergence tolerance: 9.472e-06 > > vcov(fit0 ) e0 eMax delta1 delta2 e0 0.672788555 -0.2729452009 2.029556e-01 8.893435e-02 eMax -0.272945201 0.4834404097 -4.411253e-02 1.212204e-02 delta1 0.202955602 -0.0441125316 3.606932e-01 1.869163e-01 delta2 0.088934352 0.0121220371 1.869163e-01 1.106931e-01 age -0.003530727 0.0001030079 4.984077e-05 7.767012e-05 centergreen -0.234450342 -0.0348602441 1.207912e-02 1.405608e-03 centerred -0.253662862 -0.0121021695 6.628052e-04 -2.474391e-03 centersilver -0.222055302 -0.0379891034 1.347032e-02 4.810797e-03 centeryellow -0.242096858 -0.0036488338 1.244170e-02 2.099443e-03 age centergreen centerred centersilver e0 -3.530727e-03 -0.2344503416 -0.2536628616 -2.220553e-01 eMax 1.030079e-04 -0.0348602441 -0.0121021695 -3.798910e-02 delta1 4.984077e-05 0.0120791216 0.0006628052 1.347032e-02 delta2 7.767012e-05 0.0014056079 -0.0024743906 4.810797e-03 age 6.868689e-05 0.0001513555 0.0001912581 -2.484136e-05 centergreen 1.513555e-04 0.5437481113 0.2513884520 2.524566e-01 centerred 1.912581e-04 0.2513884520 0.5551521388 2.504165e-01 centersilver -2.484136e-05 0.2524565639 0.2504164883 4.913597e-01 centeryellow -1.767809e-05 0.2510775793 0.2504115027 2.500668e-01 centeryellow e0 -2.420969e-01 eMax -3.648834e-03 delta1 1.244170e-02 delta2 2.099443e-03 age -1.767809e-05 centergreen 2.510776e-01 centerred 2.504115e-01 centersilver 2.500668e-01 centeryellow 5.369021e-01 > vcov(fitnls) delta1 delta2 .lin.(Intercept) .lin.centergreen delta1 3.606961e-01 1.869176e-01 0.202956171 0.0120792615 delta2 1.869176e-01 1.106938e-01 0.088934648 0.0014056742 .lin.(Intercept) 2.029562e-01 8.893465e-02 0.672787602 -0.2344503743 .lin.centergreen 1.207926e-02 1.405674e-03 -0.234450374 0.5437481112 .lin.centerred 6.627065e-04 -2.474441e-03 -0.253662951 0.2513884457 .lin.centersilver 1.347037e-02 4.810825e-03 -0.222055391 0.2524565593 .lin.centeryellow 1.244156e-02 2.099363e-03 -0.242097015 0.2510775716 .lin.age 4.984142e-05 7.767047e-05 -0.003530726 0.0001513556 .lin7 -4.411231e-02 1.212224e-02 -0.272944309 -0.0348602205 .lin.centerred .lin.centersilver .lin.centeryellow delta1 0.0006627065 1.347037e-02 1.244156e-02 delta2 -0.0024744413 4.810825e-03 2.099363e-03 .lin.(Intercept) -0.2536629506 -2.220554e-01 -2.420970e-01 .lin.centergreen 0.2513884457 2.524566e-01 2.510776e-01 .lin.centerred 0.5551521364 2.504165e-01 2.504115e-01 .lin.centersilver 0.2504164813 4.913597e-01 2.500668e-01 .lin.centeryellow 0.2504114958 2.500668e-01 5.369021e-01 .lin.age 0.0001912581 -2.484131e-05 -1.767806e-05 .lin7 -0.0121021533 -3.798904e-02 -3.648777e-03 .lin.age .lin7 delta1 4.984142e-05 -0.0441123055 delta2 7.767047e-05 0.0121222432 .lin.(Intercept) -3.530726e-03 -0.2729443093 .lin.centergreen 1.513556e-04 -0.0348602205 .lin.centerred 1.912581e-04 -0.0121021533 .lin.centersilver -2.484131e-05 -0.0379890373 .lin.centeryellow -1.767806e-05 -0.0036487770 .lin.age 6.868689e-05 0.0001030081 .lin7 1.030081e-04 0.4834404337 > > predict(fit0, predType="effect-curve", doseSeq = c(0, 100), se.fit=T) $fit [1] 0.000000 2.289162 $se.fit [1] 0.0000000 0.7519464 > > predict(fit0, predType="full-model", se.fit=T, + newdata = data.frame(x = c(0,100), center = as.factor("yellow"), age = 50)) $fit [1] 10.91275 13.20191 $se.fit [1] 0.7364602 0.6423551 > > TD(fit0, Delta = 1) [1] 65.39866 > > > ######################################################################## > #### emax Model > set.seed(15) > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > bnds <- c(1e-5, max(datset$x)) > fit0 <- fitMod(x,y, datset, model="emax", addCovars = ~1, bnds=bnds) > fitnls <- nls(y~emax(x, e0, emax, ed50), + start=c(e0=-1, emax=1.3, ed50=0.1), data=datset) > AIC(fit0) [1] -485.5937 > AIC(fitnls) [1] -485.5937 > summary(fit0) Dose Response Model Model: emax Fit-type: normal Residuals: Min 1Q Median 3Q Max -0.0666 -0.0180 -0.0011 0.0193 0.0692 Coefficients with approx. stand. error: Estimate Std. Error e0 -0.5830 6.00e-03 eMax 0.0163 3.36e-02 ed50 286.5994 1.91e+03 Residual standard error: 0.0281 Degrees of freedom: 111 > summary(fitnls) Formula: y ~ emax(x, e0, emax, ed50) Parameters: Estimate Std. Error t value Pr(>|t|) e0 -0.58297 0.00600 -97.164 <2e-16 *** emax 0.01632 0.03356 0.486 0.628 ed50 286.45918 1905.11276 0.150 0.881 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02814 on 111 degrees of freedom Number of iterations to convergence: 8 Achieved convergence tolerance: 9.607e-06 > > vcov(fit0 ) e0 eMax ed50 e0 3.599786e-05 -2.913476e-05 1.313843e+00 eMax -2.913476e-05 1.126946e-03 6.130311e+01 ed50 1.313843e+00 6.130311e+01 3.631673e+06 > vcov(fitnls) e0 emax ed50 e0 3.599786e-05 -2.914142e-05 1.313001e+00 emax -2.914142e-05 1.126323e-03 6.126673e+01 ed50 1.313001e+00 6.126673e+01 3.629455e+06 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 0.01155472 0.01155472 0.00000000 0.01155472 0.01155472 0.01155472 [7] 0.01056820 0.01056820 0.01056820 0.01155472 0.01239306 0.01056820 [13] 0.00000000 0.01239306 0.01155472 0.01056820 0.01056820 0.00000000 [19] 0.01155472 0.01212084 0.01212084 0.01056820 0.00000000 0.01155472 [25] 0.01056820 0.01056820 0.01155472 0.00000000 0.00000000 0.01155472 [31] 0.01056820 0.01155472 0.01056820 0.01056820 0.00000000 0.01056820 [37] 0.01155472 0.01212084 0.00000000 0.01155472 0.01239306 0.01155472 [43] 0.01056820 0.01056820 0.01155472 0.01155472 0.01155472 0.00000000 [49] 0.01155472 0.01056820 0.01056820 0.00000000 0.01056820 0.01239306 [55] 0.00000000 0.01056820 0.01155472 0.01056820 0.01239306 0.01239306 [61] 0.01056820 0.01239306 0.01056820 0.01155472 0.01212084 0.01155472 [67] 0.01056820 0.01056820 0.01239306 0.01056820 0.00000000 0.01155472 [73] 0.01239306 0.01155472 0.01155472 0.01056820 0.00000000 0.00000000 [79] 0.01155472 0.00000000 0.00000000 0.00000000 0.01155472 0.01155472 [85] 0.01056820 0.01056820 0.01155472 0.01056820 0.01155472 0.01155472 [91] 0.01212084 0.01155472 0.01212084 0.01056820 0.00000000 0.01155472 [97] 0.01155472 0.01056820 0.01155472 0.00000000 0.01155472 0.01155472 [103] 0.01056820 0.01056820 0.01056820 0.00000000 0.01155472 0.00000000 [109] 0.01056820 0.01056820 0.01155472 0.01056820 0.00000000 0.01056820 $se.fit [1] 0.006800657 0.006800657 0.000000000 0.006800657 0.006800657 0.006800657 [7] 0.007368990 0.007368990 0.007368990 0.006800657 0.008598392 0.007368990 [13] 0.000000000 0.008598392 0.006800657 0.007368990 0.007368990 0.000000000 [19] 0.006800657 0.007779856 0.007779856 0.007368990 0.000000000 0.006800657 [25] 0.007368990 0.007368990 0.006800657 0.000000000 0.000000000 0.006800657 [31] 0.007368990 0.006800657 0.007368990 0.007368990 0.000000000 0.007368990 [37] 0.006800657 0.007779856 0.000000000 0.006800657 0.008598392 0.006800657 [43] 0.007368990 0.007368990 0.006800657 0.006800657 0.006800657 0.000000000 [49] 0.006800657 0.007368990 0.007368990 0.000000000 0.007368990 0.008598392 [55] 0.000000000 0.007368990 0.006800657 0.007368990 0.008598392 0.008598392 [61] 0.007368990 0.008598392 0.007368990 0.006800657 0.007779856 0.006800657 [67] 0.007368990 0.007368990 0.008598392 0.007368990 0.000000000 0.006800657 [73] 0.008598392 0.006800657 0.006800657 0.007368990 0.000000000 0.000000000 [79] 0.006800657 0.000000000 0.000000000 0.000000000 0.006800657 0.006800657 [85] 0.007368990 0.007368990 0.006800657 0.007368990 0.006800657 0.006800657 [91] 0.007779856 0.006800657 0.007779856 0.007368990 0.000000000 0.006800657 [97] 0.006800657 0.007368990 0.006800657 0.000000000 0.006800657 0.006800657 [103] 0.007368990 0.007368990 0.007368990 0.000000000 0.006800657 0.000000000 [109] 0.007368990 0.007368990 0.006800657 0.007368990 0.000000000 0.007368990 > > predict(fit0, predType="full-model", se.fit=T) $fit [1] -0.5714146 -0.5714146 -0.5829694 -0.5714146 -0.5714146 -0.5714146 [7] -0.5724012 -0.5724012 -0.5724012 -0.5714146 -0.5705763 -0.5724012 [13] -0.5829694 -0.5705763 -0.5714146 -0.5724012 -0.5724012 -0.5829694 [19] -0.5714146 -0.5708485 -0.5708485 -0.5724012 -0.5829694 -0.5714146 [25] -0.5724012 -0.5724012 -0.5714146 -0.5829694 -0.5829694 -0.5714146 [31] -0.5724012 -0.5714146 -0.5724012 -0.5724012 -0.5829694 -0.5724012 [37] -0.5714146 -0.5708485 -0.5829694 -0.5714146 -0.5705763 -0.5714146 [43] -0.5724012 -0.5724012 -0.5714146 -0.5714146 -0.5714146 -0.5829694 [49] -0.5714146 -0.5724012 -0.5724012 -0.5829694 -0.5724012 -0.5705763 [55] -0.5829694 -0.5724012 -0.5714146 -0.5724012 -0.5705763 -0.5705763 [61] -0.5724012 -0.5705763 -0.5724012 -0.5714146 -0.5708485 -0.5714146 [67] -0.5724012 -0.5724012 -0.5705763 -0.5724012 -0.5829694 -0.5714146 [73] -0.5705763 -0.5714146 -0.5714146 -0.5724012 -0.5829694 -0.5829694 [79] -0.5714146 -0.5829694 -0.5829694 -0.5829694 -0.5714146 -0.5714146 [85] -0.5724012 -0.5724012 -0.5714146 -0.5724012 -0.5714146 -0.5714146 [91] -0.5708485 -0.5714146 -0.5708485 -0.5724012 -0.5829694 -0.5714146 [97] -0.5714146 -0.5724012 -0.5714146 -0.5829694 -0.5714146 -0.5714146 [103] -0.5724012 -0.5724012 -0.5724012 -0.5829694 -0.5714146 -0.5829694 [109] -0.5724012 -0.5724012 -0.5714146 -0.5724012 -0.5829694 -0.5724012 $se.fit [1] 0.003169353 0.003169353 0.005999821 0.003169353 0.003169353 0.003169353 [7] 0.004290400 0.004290400 0.004290400 0.003169353 0.006190654 0.004290400 [13] 0.005999821 0.006190654 0.003169353 0.004290400 0.004290400 0.005999821 [19] 0.003169353 0.004963663 0.004963663 0.004290400 0.005999821 0.003169353 [25] 0.004290400 0.004290400 0.003169353 0.005999821 0.005999821 0.003169353 [31] 0.004290400 0.003169353 0.004290400 0.004290400 0.005999821 0.004290400 [37] 0.003169353 0.004963663 0.005999821 0.003169353 0.006190654 0.003169353 [43] 0.004290400 0.004290400 0.003169353 0.003169353 0.003169353 0.005999821 [49] 0.003169353 0.004290400 0.004290400 0.005999821 0.004290400 0.006190654 [55] 0.005999821 0.004290400 0.003169353 0.004290400 0.006190654 0.006190654 [61] 0.004290400 0.006190654 0.004290400 0.003169353 0.004963663 0.003169353 [67] 0.004290400 0.004290400 0.006190654 0.004290400 0.005999821 0.003169353 [73] 0.006190654 0.003169353 0.003169353 0.004290400 0.005999821 0.005999821 [79] 0.003169353 0.005999821 0.005999821 0.005999821 0.003169353 0.003169353 [85] 0.004290400 0.004290400 0.003169353 0.004290400 0.003169353 0.003169353 [91] 0.004963663 0.003169353 0.004963663 0.004290400 0.005999821 0.003169353 [97] 0.003169353 0.004290400 0.003169353 0.005999821 0.003169353 0.003169353 [103] 0.004290400 0.004290400 0.004290400 0.005999821 0.003169353 0.005999821 [109] 0.004290400 0.004290400 0.003169353 0.004290400 0.005999821 0.004290400 > > TD(fit0, Delta = 0.005) [1] 126.5178 > > # with covariates > fit0 <- fitMod(x,y, datset, model="emax", addCovars = ~age+center, bnds=bnds) > XX <- model.matrix(~center+age, data=datset) > fitnls <- nls(y~cbind(XX, emax(x, 0, 1, ed50)), + data=datset, start=list(ed50=1), algorithm = "plinear") > AIC(fit0) [1] -481.376 > AIC(fitnls) [1] -481.378 > summary(fit0) Dose Response Model Model: emax Fit-type: normal Residuals: Min 1Q Median 3Q Max -0.07408 -0.01641 -0.00232 0.01807 0.07476 Coefficients with approx. stand. error: Estimate Std. Error e0 -5.81e-01 8.97e-03 eMax 2.93e-02 9.13e-02 ed50 9.03e+02 5.00e+03 age -1.22e-04 1.06e-04 centergreen 1.07e-02 8.31e-03 centerred 9.27e-03 7.73e-03 centersilver 1.22e-03 8.91e-03 centeryellow -4.65e-03 8.50e-03 Residual standard error: 0.0281 Degrees of freedom: 106 > summary(fitnls) Formula: y ~ cbind(XX, emax(x, 0, 1, ed50)) Parameters: Estimate Std. Error t value Pr(>|t|) ed50 1.111e+03 6.451e+03 0.172 0.864 .lin.(Intercept) -5.813e-01 8.970e-03 -64.810 <2e-16 *** .lin.centergreen 1.071e-02 8.309e-03 1.288 0.200 .lin.centerred 9.301e-03 7.726e-03 1.204 0.231 .lin.centersilver 1.196e-03 8.915e-03 0.134 0.894 .lin.centeryellow -4.665e-03 8.497e-03 -0.549 0.584 .lin.age -1.213e-04 1.057e-04 -1.148 0.254 .lin7 3.300e-02 1.170e-01 0.282 0.778 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02808 on 106 degrees of freedom Number of iterations to convergence: 9 Achieved convergence tolerance: 7.028e-06 > > vcov(fit0 ) e0 eMax ed50 age e0 8.046543e-05 -3.844545e-05 2.355425e+00 -4.980066e-07 eMax -3.844545e-05 8.342573e-03 4.493061e+02 1.107091e-06 ed50 2.355425e+00 4.493061e+02 2.497229e+07 6.444381e-02 age -4.980066e-07 1.107091e-06 6.444381e-02 1.116195e-08 centergreen -1.978501e-05 6.446464e-05 4.524614e+00 -8.645567e-08 centerred -3.432079e-05 7.922237e-05 3.670388e+00 1.157010e-08 centersilver -1.753629e-05 -7.656779e-05 -3.796015e+00 -2.309374e-07 centeryellow -3.332560e-05 -5.044361e-05 -2.141277e+00 1.346886e-07 centergreen centerred centersilver centeryellow e0 -1.978501e-05 -3.432079e-05 -1.753629e-05 -3.332560e-05 eMax 6.446464e-05 7.922237e-05 -7.656779e-05 -5.044361e-05 ed50 4.524614e+00 3.670388e+00 -3.796015e+00 -2.141277e+00 age -8.645567e-08 1.157010e-08 -2.309374e-07 1.346886e-07 centergreen 6.902160e-05 3.007695e-05 3.223410e-05 2.943878e-05 centerred 3.007695e-05 5.968790e-05 2.924362e-05 2.945739e-05 centersilver 3.223410e-05 2.924362e-05 7.947639e-05 2.823145e-05 centeryellow 2.943878e-05 2.945739e-05 2.823145e-05 7.219729e-05 > vcov(fitnls) ed50 .lin.(Intercept) .lin.centergreen ed50 4.162109e+07 3.618133e+00 6.072527e+00 .lin.(Intercept) 3.618133e+00 8.045192e-05 -1.978784e-05 .lin.centergreen 6.072527e+00 -1.978784e-05 6.904772e-05 .lin.centerred 4.627132e+00 -3.432899e-05 3.008663e-05 .lin.centersilver -4.847154e+00 -1.752828e-05 3.222029e-05 .lin.centeryellow -2.727240e+00 -3.332482e-05 2.942341e-05 .lin.age 8.505295e-02 -4.980346e-07 -8.605363e-08 .lin7 7.456212e+02 -2.614221e-05 9.001668e-05 .lin.centerred .lin.centersilver .lin.centeryellow ed50 4.627132e+00 -4.847154e+00 -2.727240e+00 .lin.(Intercept) -3.432899e-05 -1.752828e-05 -3.332482e-05 .lin.centergreen 3.008663e-05 3.222029e-05 2.942341e-05 .lin.centerred 5.968601e-05 2.924192e-05 2.945040e-05 .lin.centersilver 2.924192e-05 7.947836e-05 2.823890e-05 .lin.centeryellow 2.945040e-05 2.823890e-05 7.220391e-05 .lin.age 1.172543e-08 -2.311322e-07 1.344697e-07 .lin7 9.802604e-05 -9.643580e-05 -6.245218e-05 .lin.age .lin7 ed50 8.505295e-02 7.456212e+02 .lin.(Intercept) -4.980346e-07 -2.614221e-05 .lin.centergreen -8.605363e-08 9.001668e-05 .lin.centerred 1.172543e-08 9.802604e-05 .lin.centersilver -2.311322e-07 -9.643580e-05 .lin.centeryellow 1.344697e-07 -6.245218e-05 .lin.age 1.116761e-08 1.469361e-06 .lin7 1.469361e-06 1.368628e-02 > > predict(fit0, predType="effect-curve", doseSeq = c(0, 100), se.fit=T) $fit [1] 0.000000000 0.002916944 $se.fit [1] 0.000000 0.005795 > > predict(fit0, predType="full-model", se.fit=T, + newdata = data.frame(x = c(0,100), center = as.factor("silver"), age = 50)) $fit [1] -0.5861913 -0.5832744 $se.fit [1] 0.008937545 0.009550033 > > TD(fit0, Delta = 0.005) [1] 186.1323 > > ######################################################################## > #### sigEmax Model > ## set.seed(25) # example where nls and bndnls find different optimum > set.seed(13) > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > bnds <- matrix(c(1e-5, 1e-5, max(datset$x), 30), nrow=2) > fit0 <- fitMod(x,y, datset, model = "sigEmax", addCovars = ~1, bnds=bnds) > fitnls <- nls(y~sigEmax(x, e0, emax, ed50, h), + start=c(e0=6, emax=17, ed50=240, h=2), data=datset) > AIC(fit0) [1] 2049.321 > AIC(fitnls) [1] 2049.321 > summary(fit0) Dose Response Model Model: sigEmax Fit-type: normal Residuals: Min 1Q Median 3Q Max -13.6383 -2.8339 0.0791 3.0983 10.5294 Coefficients with approx. stand. error: Estimate Std. Error e0 -10.92 0.555 eMax 17.17 3.430 ed50 379.22 148.679 h 1.38 0.349 Residual standard error: 4.37 Degrees of freedom: 349 > summary(fitnls) Formula: y ~ sigEmax(x, e0, emax, ed50, h) Parameters: Estimate Std. Error t value Pr(>|t|) e0 -10.9166 0.5552 -19.664 < 2e-16 *** emax 17.1659 3.4296 5.005 8.87e-07 *** ed50 379.2177 148.6773 2.551 0.0112 * h 1.3754 0.3490 3.941 9.81e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.372 on 349 degrees of freedom Number of iterations to convergence: 4 Achieved convergence tolerance: 7.009e-07 > > vcov(fit0 ) e0 eMax ed50 h e0 0.30821303 -0.518459 6.111486 0.06026433 eMax -0.51845900 11.762553 468.796873 -1.10430569 ed50 6.11148634 468.796873 22105.397044 -40.29692787 h 0.06026433 -1.104306 -40.296928 0.12181039 > vcov(fitnls) e0 emax ed50 h e0 0.30821303 -0.5184566 6.111568 0.06026447 emax -0.51845655 11.7623435 468.787156 -1.10429851 ed50 6.11156813 468.7871558 22104.941251 -40.29652562 h 0.06026447 -1.1042985 -40.296526 0.12181099 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 12.497935 12.497935 13.842361 2.869998 13.842361 13.842361 0.000000 [8] 0.000000 13.842361 2.869998 12.497935 12.497935 11.114421 12.497935 [15] 12.497935 12.497935 12.497935 12.497935 0.000000 12.497935 12.497935 [22] 0.000000 13.842361 13.842361 0.000000 0.000000 2.869998 12.497935 [29] 2.869998 2.869998 13.842361 0.000000 11.114421 12.497935 0.000000 [36] 13.842361 13.842361 12.497935 13.842361 2.869998 12.497935 12.497935 [43] 12.497935 2.869998 12.497935 12.497935 11.114421 12.497935 13.842361 [50] 13.842361 12.497935 0.000000 12.497935 12.497935 0.000000 12.497935 [57] 0.000000 13.842361 12.497935 2.869998 12.497935 13.842361 12.497935 [64] 13.842361 13.842361 12.497935 12.497935 2.869998 12.497935 2.869998 [71] 12.497935 2.869998 12.497935 12.497935 0.000000 13.842361 0.000000 [78] 13.842361 12.497935 12.497935 12.497935 12.497935 13.842361 2.869998 [85] 12.497935 12.497935 12.497935 0.000000 0.000000 0.000000 0.000000 [92] 2.869998 12.497935 12.497935 2.869998 12.497935 12.497935 2.869998 [99] 12.497935 0.000000 12.497935 0.000000 2.869998 2.869998 2.869998 [106] 12.497935 13.842361 12.497935 2.869998 0.000000 13.842361 2.869998 [113] 12.497935 0.000000 12.497935 0.000000 13.842361 12.497935 0.000000 [120] 12.497935 11.114421 13.842361 12.497935 12.497935 0.000000 12.497935 [127] 2.869998 13.842361 12.497935 13.842361 12.497935 2.869998 12.497935 [134] 12.497935 12.497935 12.497935 12.497935 13.842361 13.842361 0.000000 [141] 11.114421 12.497935 0.000000 12.497935 13.842361 12.497935 11.114421 [148] 12.497935 0.000000 0.000000 2.869998 13.842361 0.000000 2.869998 [155] 13.842361 2.869998 11.114421 11.114421 12.497935 0.000000 12.497935 [162] 12.497935 2.869998 2.869998 12.497935 12.497935 12.497935 12.497935 [169] 2.869998 11.114421 0.000000 13.842361 12.497935 11.114421 12.497935 [176] 13.842361 13.842361 12.497935 12.497935 12.497935 12.497935 12.497935 [183] 2.869998 13.842361 0.000000 12.497935 12.497935 12.497935 2.869998 [190] 13.842361 12.497935 13.842361 2.869998 13.842361 12.497935 12.497935 [197] 12.497935 0.000000 11.114421 2.869998 12.497935 2.869998 12.497935 [204] 0.000000 12.497935 13.842361 12.497935 13.842361 12.497935 2.869998 [211] 2.869998 12.497935 13.842361 13.842361 2.869998 0.000000 13.842361 [218] 12.497935 12.497935 0.000000 13.842361 12.497935 12.497935 0.000000 [225] 13.842361 11.114421 12.497935 2.869998 12.497935 0.000000 12.497935 [232] 12.497935 13.842361 0.000000 12.497935 12.497935 13.842361 0.000000 [239] 13.842361 13.842361 12.497935 13.842361 0.000000 2.869998 12.497935 [246] 13.842361 12.497935 12.497935 13.842361 2.869998 0.000000 0.000000 [253] 11.114421 2.869998 12.497935 2.869998 13.842361 0.000000 12.497935 [260] 12.497935 12.497935 12.497935 11.114421 0.000000 0.000000 0.000000 [267] 0.000000 0.000000 0.000000 12.497935 13.842361 13.842361 2.869998 [274] 12.497935 12.497935 12.497935 2.869998 13.842361 12.497935 13.842361 [281] 12.497935 12.497935 12.497935 12.497935 2.869998 13.842361 12.497935 [288] 11.114421 0.000000 12.497935 12.497935 0.000000 2.869998 12.497935 [295] 0.000000 0.000000 13.842361 0.000000 12.497935 13.842361 12.497935 [302] 12.497935 13.842361 12.497935 12.497935 2.869998 12.497935 2.869998 [309] 11.114421 2.869998 2.869998 0.000000 13.842361 0.000000 12.497935 [316] 2.869998 13.842361 0.000000 13.842361 11.114421 12.497935 0.000000 [323] 12.497935 12.497935 0.000000 13.842361 13.842361 13.842361 13.842361 [330] 11.114421 2.869998 0.000000 12.497935 0.000000 12.497935 13.842361 [337] 12.497935 12.497935 12.497935 12.497935 12.497935 13.842361 12.497935 [344] 2.869998 13.842361 13.842361 2.869998 11.114421 2.869998 12.497935 [351] 12.497935 12.497935 13.842361 $se.fit [1] 0.6365415 0.6365415 0.7457881 0.8126372 0.7457881 0.7457881 0.0000000 [8] 0.0000000 0.7457881 0.8126372 0.6365415 0.6365415 0.8003756 0.6365415 [15] 0.6365415 0.6365415 0.6365415 0.6365415 0.0000000 0.6365415 0.6365415 [22] 0.0000000 0.7457881 0.7457881 0.0000000 0.0000000 0.8126372 0.6365415 [29] 0.8126372 0.8126372 0.7457881 0.0000000 0.8003756 0.6365415 0.0000000 [36] 0.7457881 0.7457881 0.6365415 0.7457881 0.8126372 0.6365415 0.6365415 [43] 0.6365415 0.8126372 0.6365415 0.6365415 0.8003756 0.6365415 0.7457881 [50] 0.7457881 0.6365415 0.0000000 0.6365415 0.6365415 0.0000000 0.6365415 [57] 0.0000000 0.7457881 0.6365415 0.8126372 0.6365415 0.7457881 0.6365415 [64] 0.7457881 0.7457881 0.6365415 0.6365415 0.8126372 0.6365415 0.8126372 [71] 0.6365415 0.8126372 0.6365415 0.6365415 0.0000000 0.7457881 0.0000000 [78] 0.7457881 0.6365415 0.6365415 0.6365415 0.6365415 0.7457881 0.8126372 [85] 0.6365415 0.6365415 0.6365415 0.0000000 0.0000000 0.0000000 0.0000000 [92] 0.8126372 0.6365415 0.6365415 0.8126372 0.6365415 0.6365415 0.8126372 [99] 0.6365415 0.0000000 0.6365415 0.0000000 0.8126372 0.8126372 0.8126372 [106] 0.6365415 0.7457881 0.6365415 0.8126372 0.0000000 0.7457881 0.8126372 [113] 0.6365415 0.0000000 0.6365415 0.0000000 0.7457881 0.6365415 0.0000000 [120] 0.6365415 0.8003756 0.7457881 0.6365415 0.6365415 0.0000000 0.6365415 [127] 0.8126372 0.7457881 0.6365415 0.7457881 0.6365415 0.8126372 0.6365415 [134] 0.6365415 0.6365415 0.6365415 0.6365415 0.7457881 0.7457881 0.0000000 [141] 0.8003756 0.6365415 0.0000000 0.6365415 0.7457881 0.6365415 0.8003756 [148] 0.6365415 0.0000000 0.0000000 0.8126372 0.7457881 0.0000000 0.8126372 [155] 0.7457881 0.8126372 0.8003756 0.8003756 0.6365415 0.0000000 0.6365415 [162] 0.6365415 0.8126372 0.8126372 0.6365415 0.6365415 0.6365415 0.6365415 [169] 0.8126372 0.8003756 0.0000000 0.7457881 0.6365415 0.8003756 0.6365415 [176] 0.7457881 0.7457881 0.6365415 0.6365415 0.6365415 0.6365415 0.6365415 [183] 0.8126372 0.7457881 0.0000000 0.6365415 0.6365415 0.6365415 0.8126372 [190] 0.7457881 0.6365415 0.7457881 0.8126372 0.7457881 0.6365415 0.6365415 [197] 0.6365415 0.0000000 0.8003756 0.8126372 0.6365415 0.8126372 0.6365415 [204] 0.0000000 0.6365415 0.7457881 0.6365415 0.7457881 0.6365415 0.8126372 [211] 0.8126372 0.6365415 0.7457881 0.7457881 0.8126372 0.0000000 0.7457881 [218] 0.6365415 0.6365415 0.0000000 0.7457881 0.6365415 0.6365415 0.0000000 [225] 0.7457881 0.8003756 0.6365415 0.8126372 0.6365415 0.0000000 0.6365415 [232] 0.6365415 0.7457881 0.0000000 0.6365415 0.6365415 0.7457881 0.0000000 [239] 0.7457881 0.7457881 0.6365415 0.7457881 0.0000000 0.8126372 0.6365415 [246] 0.7457881 0.6365415 0.6365415 0.7457881 0.8126372 0.0000000 0.0000000 [253] 0.8003756 0.8126372 0.6365415 0.8126372 0.7457881 0.0000000 0.6365415 [260] 0.6365415 0.6365415 0.6365415 0.8003756 0.0000000 0.0000000 0.0000000 [267] 0.0000000 0.0000000 0.0000000 0.6365415 0.7457881 0.7457881 0.8126372 [274] 0.6365415 0.6365415 0.6365415 0.8126372 0.7457881 0.6365415 0.7457881 [281] 0.6365415 0.6365415 0.6365415 0.6365415 0.8126372 0.7457881 0.6365415 [288] 0.8003756 0.0000000 0.6365415 0.6365415 0.0000000 0.8126372 0.6365415 [295] 0.0000000 0.0000000 0.7457881 0.0000000 0.6365415 0.7457881 0.6365415 [302] 0.6365415 0.7457881 0.6365415 0.6365415 0.8126372 0.6365415 0.8126372 [309] 0.8003756 0.8126372 0.8126372 0.0000000 0.7457881 0.0000000 0.6365415 [316] 0.8126372 0.7457881 0.0000000 0.7457881 0.8003756 0.6365415 0.0000000 [323] 0.6365415 0.6365415 0.0000000 0.7457881 0.7457881 0.7457881 0.7457881 [330] 0.8003756 0.8126372 0.0000000 0.6365415 0.0000000 0.6365415 0.7457881 [337] 0.6365415 0.6365415 0.6365415 0.6365415 0.6365415 0.7457881 0.6365415 [344] 0.8126372 0.7457881 0.7457881 0.8126372 0.8003756 0.8126372 0.6365415 [351] 0.6365415 0.6365415 0.7457881 > > predict(fit0, predType="full-model", se.fit=T) $fit [1] 1.5813420 1.5813420 2.9257679 -8.0465953 2.9257679 2.9257679 [7] -10.9165932 -10.9165932 2.9257679 -8.0465953 1.5813420 1.5813420 [13] 0.1978277 1.5813420 1.5813420 1.5813420 1.5813420 1.5813420 [19] -10.9165932 1.5813420 1.5813420 -10.9165932 2.9257679 2.9257679 [25] -10.9165932 -10.9165932 -8.0465953 1.5813420 -8.0465953 -8.0465953 [31] 2.9257679 -10.9165932 0.1978277 1.5813420 -10.9165932 2.9257679 [37] 2.9257679 1.5813420 2.9257679 -8.0465953 1.5813420 1.5813420 [43] 1.5813420 -8.0465953 1.5813420 1.5813420 0.1978277 1.5813420 [49] 2.9257679 2.9257679 1.5813420 -10.9165932 1.5813420 1.5813420 [55] -10.9165932 1.5813420 -10.9165932 2.9257679 1.5813420 -8.0465953 [61] 1.5813420 2.9257679 1.5813420 2.9257679 2.9257679 1.5813420 [67] 1.5813420 -8.0465953 1.5813420 -8.0465953 1.5813420 -8.0465953 [73] 1.5813420 1.5813420 -10.9165932 2.9257679 -10.9165932 2.9257679 [79] 1.5813420 1.5813420 1.5813420 1.5813420 2.9257679 -8.0465953 [85] 1.5813420 1.5813420 1.5813420 -10.9165932 -10.9165932 -10.9165932 [91] -10.9165932 -8.0465953 1.5813420 1.5813420 -8.0465953 1.5813420 [97] 1.5813420 -8.0465953 1.5813420 -10.9165932 1.5813420 -10.9165932 [103] -8.0465953 -8.0465953 -8.0465953 1.5813420 2.9257679 1.5813420 [109] -8.0465953 -10.9165932 2.9257679 -8.0465953 1.5813420 -10.9165932 [115] 1.5813420 -10.9165932 2.9257679 1.5813420 -10.9165932 1.5813420 [121] 0.1978277 2.9257679 1.5813420 1.5813420 -10.9165932 1.5813420 [127] -8.0465953 2.9257679 1.5813420 2.9257679 1.5813420 -8.0465953 [133] 1.5813420 1.5813420 1.5813420 1.5813420 1.5813420 2.9257679 [139] 2.9257679 -10.9165932 0.1978277 1.5813420 -10.9165932 1.5813420 [145] 2.9257679 1.5813420 0.1978277 1.5813420 -10.9165932 -10.9165932 [151] -8.0465953 2.9257679 -10.9165932 -8.0465953 2.9257679 -8.0465953 [157] 0.1978277 0.1978277 1.5813420 -10.9165932 1.5813420 1.5813420 [163] -8.0465953 -8.0465953 1.5813420 1.5813420 1.5813420 1.5813420 [169] -8.0465953 0.1978277 -10.9165932 2.9257679 1.5813420 0.1978277 [175] 1.5813420 2.9257679 2.9257679 1.5813420 1.5813420 1.5813420 [181] 1.5813420 1.5813420 -8.0465953 2.9257679 -10.9165932 1.5813420 [187] 1.5813420 1.5813420 -8.0465953 2.9257679 1.5813420 2.9257679 [193] -8.0465953 2.9257679 1.5813420 1.5813420 1.5813420 -10.9165932 [199] 0.1978277 -8.0465953 1.5813420 -8.0465953 1.5813420 -10.9165932 [205] 1.5813420 2.9257679 1.5813420 2.9257679 1.5813420 -8.0465953 [211] -8.0465953 1.5813420 2.9257679 2.9257679 -8.0465953 -10.9165932 [217] 2.9257679 1.5813420 1.5813420 -10.9165932 2.9257679 1.5813420 [223] 1.5813420 -10.9165932 2.9257679 0.1978277 1.5813420 -8.0465953 [229] 1.5813420 -10.9165932 1.5813420 1.5813420 2.9257679 -10.9165932 [235] 1.5813420 1.5813420 2.9257679 -10.9165932 2.9257679 2.9257679 [241] 1.5813420 2.9257679 -10.9165932 -8.0465953 1.5813420 2.9257679 [247] 1.5813420 1.5813420 2.9257679 -8.0465953 -10.9165932 -10.9165932 [253] 0.1978277 -8.0465953 1.5813420 -8.0465953 2.9257679 -10.9165932 [259] 1.5813420 1.5813420 1.5813420 1.5813420 0.1978277 -10.9165932 [265] -10.9165932 -10.9165932 -10.9165932 -10.9165932 -10.9165932 1.5813420 [271] 2.9257679 2.9257679 -8.0465953 1.5813420 1.5813420 1.5813420 [277] -8.0465953 2.9257679 1.5813420 2.9257679 1.5813420 1.5813420 [283] 1.5813420 1.5813420 -8.0465953 2.9257679 1.5813420 0.1978277 [289] -10.9165932 1.5813420 1.5813420 -10.9165932 -8.0465953 1.5813420 [295] -10.9165932 -10.9165932 2.9257679 -10.9165932 1.5813420 2.9257679 [301] 1.5813420 1.5813420 2.9257679 1.5813420 1.5813420 -8.0465953 [307] 1.5813420 -8.0465953 0.1978277 -8.0465953 -8.0465953 -10.9165932 [313] 2.9257679 -10.9165932 1.5813420 -8.0465953 2.9257679 -10.9165932 [319] 2.9257679 0.1978277 1.5813420 -10.9165932 1.5813420 1.5813420 [325] -10.9165932 2.9257679 2.9257679 2.9257679 2.9257679 0.1978277 [331] -8.0465953 -10.9165932 1.5813420 -10.9165932 1.5813420 2.9257679 [337] 1.5813420 1.5813420 1.5813420 1.5813420 1.5813420 2.9257679 [343] 1.5813420 -8.0465953 2.9257679 2.9257679 -8.0465953 0.1978277 [349] -8.0465953 1.5813420 1.5813420 1.5813420 2.9257679 $se.fit [1] 0.3179632 0.3179632 0.4944930 0.5940988 0.4944930 0.4944930 0.5551694 [8] 0.5551694 0.4944930 0.5940988 0.3179632 0.3179632 0.5590023 0.3179632 [15] 0.3179632 0.3179632 0.3179632 0.3179632 0.5551694 0.3179632 0.3179632 [22] 0.5551694 0.4944930 0.4944930 0.5551694 0.5551694 0.5940988 0.3179632 [29] 0.5940988 0.5940988 0.4944930 0.5551694 0.5590023 0.3179632 0.5551694 [36] 0.4944930 0.4944930 0.3179632 0.4944930 0.5940988 0.3179632 0.3179632 [43] 0.3179632 0.5940988 0.3179632 0.3179632 0.5590023 0.3179632 0.4944930 [50] 0.4944930 0.3179632 0.5551694 0.3179632 0.3179632 0.5551694 0.3179632 [57] 0.5551694 0.4944930 0.3179632 0.5940988 0.3179632 0.4944930 0.3179632 [64] 0.4944930 0.4944930 0.3179632 0.3179632 0.5940988 0.3179632 0.5940988 [71] 0.3179632 0.5940988 0.3179632 0.3179632 0.5551694 0.4944930 0.5551694 [78] 0.4944930 0.3179632 0.3179632 0.3179632 0.3179632 0.4944930 0.5940988 [85] 0.3179632 0.3179632 0.3179632 0.5551694 0.5551694 0.5551694 0.5551694 [92] 0.5940988 0.3179632 0.3179632 0.5940988 0.3179632 0.3179632 0.5940988 [99] 0.3179632 0.5551694 0.3179632 0.5551694 0.5940988 0.5940988 0.5940988 [106] 0.3179632 0.4944930 0.3179632 0.5940988 0.5551694 0.4944930 0.5940988 [113] 0.3179632 0.5551694 0.3179632 0.5551694 0.4944930 0.3179632 0.5551694 [120] 0.3179632 0.5590023 0.4944930 0.3179632 0.3179632 0.5551694 0.3179632 [127] 0.5940988 0.4944930 0.3179632 0.4944930 0.3179632 0.5940988 0.3179632 [134] 0.3179632 0.3179632 0.3179632 0.3179632 0.4944930 0.4944930 0.5551694 [141] 0.5590023 0.3179632 0.5551694 0.3179632 0.4944930 0.3179632 0.5590023 [148] 0.3179632 0.5551694 0.5551694 0.5940988 0.4944930 0.5551694 0.5940988 [155] 0.4944930 0.5940988 0.5590023 0.5590023 0.3179632 0.5551694 0.3179632 [162] 0.3179632 0.5940988 0.5940988 0.3179632 0.3179632 0.3179632 0.3179632 [169] 0.5940988 0.5590023 0.5551694 0.4944930 0.3179632 0.5590023 0.3179632 [176] 0.4944930 0.4944930 0.3179632 0.3179632 0.3179632 0.3179632 0.3179632 [183] 0.5940988 0.4944930 0.5551694 0.3179632 0.3179632 0.3179632 0.5940988 [190] 0.4944930 0.3179632 0.4944930 0.5940988 0.4944930 0.3179632 0.3179632 [197] 0.3179632 0.5551694 0.5590023 0.5940988 0.3179632 0.5940988 0.3179632 [204] 0.5551694 0.3179632 0.4944930 0.3179632 0.4944930 0.3179632 0.5940988 [211] 0.5940988 0.3179632 0.4944930 0.4944930 0.5940988 0.5551694 0.4944930 [218] 0.3179632 0.3179632 0.5551694 0.4944930 0.3179632 0.3179632 0.5551694 [225] 0.4944930 0.5590023 0.3179632 0.5940988 0.3179632 0.5551694 0.3179632 [232] 0.3179632 0.4944930 0.5551694 0.3179632 0.3179632 0.4944930 0.5551694 [239] 0.4944930 0.4944930 0.3179632 0.4944930 0.5551694 0.5940988 0.3179632 [246] 0.4944930 0.3179632 0.3179632 0.4944930 0.5940988 0.5551694 0.5551694 [253] 0.5590023 0.5940988 0.3179632 0.5940988 0.4944930 0.5551694 0.3179632 [260] 0.3179632 0.3179632 0.3179632 0.5590023 0.5551694 0.5551694 0.5551694 [267] 0.5551694 0.5551694 0.5551694 0.3179632 0.4944930 0.4944930 0.5940988 [274] 0.3179632 0.3179632 0.3179632 0.5940988 0.4944930 0.3179632 0.4944930 [281] 0.3179632 0.3179632 0.3179632 0.3179632 0.5940988 0.4944930 0.3179632 [288] 0.5590023 0.5551694 0.3179632 0.3179632 0.5551694 0.5940988 0.3179632 [295] 0.5551694 0.5551694 0.4944930 0.5551694 0.3179632 0.4944930 0.3179632 [302] 0.3179632 0.4944930 0.3179632 0.3179632 0.5940988 0.3179632 0.5940988 [309] 0.5590023 0.5940988 0.5940988 0.5551694 0.4944930 0.5551694 0.3179632 [316] 0.5940988 0.4944930 0.5551694 0.4944930 0.5590023 0.3179632 0.5551694 [323] 0.3179632 0.3179632 0.5551694 0.4944930 0.4944930 0.4944930 0.4944930 [330] 0.5590023 0.5940988 0.5551694 0.3179632 0.5551694 0.3179632 0.4944930 [337] 0.3179632 0.3179632 0.3179632 0.3179632 0.3179632 0.4944930 0.3179632 [344] 0.5940988 0.4944930 0.4944930 0.5940988 0.5590023 0.5940988 0.3179632 [351] 0.3179632 0.3179632 0.4944930 > > TD(fit0, Delta = 1) [1] 50.13645 > > # with covariates > fit0 <- fitMod(x,y, datset, model="sigEmax", addCovars = ~age+center, bnds=bnds) > XX <- model.matrix(~center+age, data=datset) > fitnls <- nls(y~cbind(XX, sigEmax(x, 0, 1, ed50, h)), + data=datset, start=list(ed50=368, h=2), algorithm = "plinear") > AIC(fit0) [1] 2052.27 > AIC(fitnls) [1] 2052.27 > summary(fit0) Dose Response Model Model: sigEmax Fit-type: normal Residuals: Min 1Q Median 3Q Max -13.6642 -2.5494 -0.0589 3.1494 10.8255 Coefficients with approx. stand. error: Estimate Std. Error e0 -9.3604 8.43e-01 eMax 18.0312 4.04e+00 ed50 427.8168 1.83e+02 h 1.3276 3.36e-01 age -0.0117 8.11e-03 centergreen -0.7488 7.57e-01 centerred -0.8859 7.12e-01 centersilver -1.4084 7.52e-01 centeryellow -1.4438 7.33e-01 Residual standard error: 4.36 Degrees of freedom: 344 > summary(fitnls) Formula: y ~ cbind(XX, sigEmax(x, 0, 1, ed50, h)) Parameters: Estimate Std. Error t value Pr(>|t|) ed50 427.813485 182.738231 2.341 0.0198 * h 1.327626 0.335875 3.953 9.38e-05 *** .lin.(Intercept) -9.360422 0.842795 -11.106 < 2e-16 *** .lin.centergreen -0.748766 0.757412 -0.989 0.3236 .lin.centerred -0.885871 0.711909 -1.244 0.2142 .lin.centersilver -1.408359 0.752071 -1.873 0.0620 . .lin.centeryellow -1.443811 0.733469 -1.968 0.0498 * .lin.age -0.011703 0.008114 -1.442 0.1501 .lin7 18.031101 4.042408 4.460 1.11e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.36 on 344 degrees of freedom Number of iterations to convergence: 4 Achieved convergence tolerance: 7.015e-06 > > vcov(fit0 ) e0 eMax ed50 h e0 0.710302651 -4.248050e-01 12.9547646 5.611113e-02 eMax -0.424805031 1.634158e+01 694.3472385 -1.241172e+00 ed50 12.954764634 6.943472e+02 33394.5386095 -4.820462e+01 h 0.056111134 -1.241172e+00 -48.2046174 1.128111e-01 age -0.003282055 -7.347999e-04 -0.0251683 3.613375e-05 centergreen -0.239527553 2.751352e-02 1.4126289 -4.650674e-03 centerred -0.290825609 -1.412230e-01 -9.3345325 5.133219e-03 centersilver -0.296694203 -2.684223e-01 -15.5401130 1.239080e-02 centeryellow -0.294618448 -1.827692e-01 -11.6914478 8.045886e-03 age centergreen centerred centersilver e0 -3.282055e-03 -0.2395275534 -2.908256e-01 -2.966942e-01 eMax -7.347999e-04 0.0275135152 -1.412230e-01 -2.684223e-01 ed50 -2.516830e-02 1.4126288560 -9.334532e+00 -1.554011e+01 h 3.613375e-05 -0.0046506738 5.133219e-03 1.239080e-02 age 6.584109e-05 -0.0004705249 3.847994e-05 1.268608e-04 centergreen -4.705249e-04 0.5736725480 2.674552e-01 2.669211e-01 centerred 3.847994e-05 0.2674552437 5.068148e-01 2.741110e-01 centersilver 1.268608e-04 0.2669210775 2.741110e-01 5.656114e-01 centeryellow 3.360823e-05 0.2672881708 2.729000e-01 2.753064e-01 centeryellow e0 -2.946184e-01 eMax -1.827692e-01 ed50 -1.169145e+01 h 8.045886e-03 age 3.360823e-05 centergreen 2.672882e-01 centerred 2.729000e-01 centersilver 2.753064e-01 centeryellow 5.379774e-01 > vcov(fitnls) ed50 h .lin.(Intercept) .lin.centergreen ed50 3.339326e+04 -4.820368e+01 12.954858536 1.4125956498 h -4.820368e+01 1.128119e-01 0.056111300 -0.0046506961 .lin.(Intercept) 1.295486e+01 5.611130e-02 0.710302646 -0.2395275486 .lin.centergreen 1.412596e+00 -4.650696e-03 -0.239527549 0.5736725489 .lin.centerred -9.334399e+00 5.133264e-03 -0.290825609 0.2674552405 .lin.centersilver -1.553987e+01 1.239088e-02 -0.296694200 0.2669210724 .lin.centeryellow -1.169127e+01 8.045945e-03 -0.294618447 0.2672881668 .lin.age -2.516784e-02 3.613396e-05 -0.003282055 -0.0004705249 .lin7 6.943216e+02 -1.241157e+00 -0.424801861 0.0275129941 .lin.centerred .lin.centersilver .lin.centeryellow ed50 -9.334399e+00 -1.553987e+01 -1.169127e+01 h 5.133264e-03 1.239088e-02 8.045945e-03 .lin.(Intercept) -2.908256e-01 -2.966942e-01 -2.946184e-01 .lin.centergreen 2.674552e-01 2.669211e-01 2.672882e-01 .lin.centerred 5.068148e-01 2.741110e-01 2.729000e-01 .lin.centersilver 2.741110e-01 5.656114e-01 2.753064e-01 .lin.centeryellow 2.729000e-01 2.753064e-01 5.379774e-01 .lin.age 3.847993e-05 1.268608e-04 3.360822e-05 .lin7 -1.412207e-01 -2.684181e-01 -1.827662e-01 .lin.age .lin7 ed50 -2.516784e-02 694.321579932 h 3.613396e-05 -1.241156974 .lin.(Intercept) -3.282055e-03 -0.424801861 .lin.centergreen -4.705249e-04 0.027512994 .lin.centerred 3.847993e-05 -0.141220710 .lin.centersilver 1.268608e-04 -0.268418091 .lin.centeryellow 3.360822e-05 -0.182766244 .lin.age 6.584109e-05 -0.000734791 .lin7 -7.347910e-04 16.341065046 > > predict(fit0, predType="effect-curve", doseSeq = c(0, 100), se.fit=T) $fit [1] 0.000000 2.286007 $se.fit [1] 0.0000000 0.7638951 > > predict(fit0, predType="full-model", se.fit=T, + newdata = data.frame(x = c(0,100), center = as.factor("silver"), age = 50)) $fit [1] -11.353936 -9.067928 $se.fit [1] 0.7291152 0.7547668 > > TD(fit0, Delta = 1) [1] 50.56495 > > ######################################################################## > #### logistic Model > set.seed(200) > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > bnds <- matrix(c(1e-5, 1e-5, max(datset$x), max(datset$x)/2), nrow=2) > fit0 <- fitMod(x,y, datset, model="logistic", addCovars = ~1, bnds=bnds) > fitnls <- nls(y~logistic(x, e0, emax, ed50, delta), + start=c(e0=0, emax=16, ed50=250, delta=90), data=datset) > AIC(fit0) [1] 336.0966 > AIC(fitnls) [1] 336.0966 > summary(fit0) Dose Response Model Model: logistic Fit-type: normal Residuals: Min 1Q Median 3Q Max -6.606 -1.402 -0.298 1.561 5.618 Coefficients with approx. stand. error: Estimate Std. Error e0 -8.93 1.09 eMax 7.45 1.19 ed50 288.28 49.89 delta 43.71 37.57 Residual standard error: 2.32 Degrees of freedom: 69 > summary(fitnls) Formula: y ~ logistic(x, e0, emax, ed50, delta) Parameters: Estimate Std. Error t value Pr(>|t|) e0 -8.931 1.092 -8.179 9.42e-12 *** emax 7.453 1.192 6.251 2.94e-08 *** ed50 288.282 49.890 5.778 1.99e-07 *** delta 43.709 37.566 1.164 0.249 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.323 on 69 degrees of freedom Number of iterations to convergence: 5 Achieved convergence tolerance: 1.876e-07 > > vcov(fit0 ) e0 eMax ed50 delta e0 1.192360 -1.220565 45.77140 -33.34815 eMax -1.220565 1.421491 -43.96678 35.28563 ed50 45.771405 -43.966776 2488.99412 -1733.71529 delta -33.348146 35.285634 -1733.71529 1411.22519 > vcov(fitnls) e0 emax ed50 delta e0 1.192360 -1.220566 45.77134 -33.34807 emax -1.220566 1.421491 -43.96671 35.28556 ed50 45.771344 -43.966710 2488.98697 -1733.70785 delta -33.348068 35.285556 -1733.70785 1411.21841 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 0.0000000 5.6020564 7.4419763 7.4430636 5.6020564 0.3578039 7.4430636 [8] 0.3578039 7.4130064 7.4419763 5.6020564 5.6020564 5.6020564 5.6020564 [15] 5.6020564 5.6020564 7.4130064 0.3578039 0.3578039 7.4419763 0.3578039 [22] 7.4430636 0.3578039 7.4419763 7.4430636 0.3578039 7.4419763 7.4419763 [29] 5.6020564 0.0000000 7.4419763 5.6020564 7.4130064 7.4130064 7.4430636 [36] 0.0000000 7.4419763 7.4430636 5.6020564 5.6020564 5.6020564 7.4419763 [43] 5.6020564 0.3578039 7.4130064 5.6020564 7.4419763 0.3578039 5.6020564 [50] 0.0000000 5.6020564 7.4130064 7.4430636 5.6020564 0.3578039 7.4419763 [57] 7.4130064 7.4430636 7.4419763 7.4430636 0.0000000 5.6020564 5.6020564 [64] 5.6020564 7.4419763 5.6020564 7.4419763 7.4130064 7.4419763 5.6020564 [71] 5.6020564 0.3578039 5.6020564 $se.fit [1] 0.000000 1.134891 1.131632 1.137062 1.134891 1.244804 1.137062 1.244804 [9] 1.051179 1.131632 1.134891 1.134891 1.134891 1.134891 1.134891 1.134891 [17] 1.051179 1.244804 1.244804 1.131632 1.244804 1.137062 1.244804 1.131632 [25] 1.137062 1.244804 1.131632 1.131632 1.134891 0.000000 1.131632 1.134891 [33] 1.051179 1.051179 1.137062 0.000000 1.131632 1.137062 1.134891 1.134891 [41] 1.134891 1.131632 1.134891 1.244804 1.051179 1.134891 1.131632 1.244804 [49] 1.134891 0.000000 1.134891 1.051179 1.137062 1.134891 1.244804 1.131632 [57] 1.051179 1.137062 1.131632 1.137062 0.000000 1.134891 1.134891 1.134891 [65] 1.131632 1.134891 1.131632 1.051179 1.131632 1.134891 1.134891 1.244804 [73] 1.134891 > > predict(fit0, predType="full-model", se.fit=T) $fit [1] -8.920547 -3.318491 -1.478571 -1.477483 -3.318491 -8.562743 -1.477483 [8] -8.562743 -1.507541 -1.478571 -3.318491 -3.318491 -3.318491 -3.318491 [15] -3.318491 -3.318491 -1.507541 -8.562743 -8.562743 -1.478571 -8.562743 [22] -1.477483 -8.562743 -1.478571 -1.477483 -8.562743 -1.478571 -1.478571 [29] -3.318491 -8.920547 -1.478571 -3.318491 -1.507541 -1.507541 -1.477483 [36] -8.920547 -1.478571 -1.477483 -3.318491 -3.318491 -3.318491 -1.478571 [43] -3.318491 -8.562743 -1.507541 -3.318491 -1.478571 -8.562743 -3.318491 [50] -8.920547 -3.318491 -1.507541 -1.477483 -3.318491 -8.562743 -1.478571 [57] -1.507541 -1.477483 -1.478571 -1.477483 -8.920547 -3.318491 -3.318491 [64] -3.318491 -1.478571 -3.318491 -1.478571 -1.507541 -1.478571 -3.318491 [71] -3.318491 -8.562743 -3.318491 $se.fit [1] 1.0345960 0.4644528 0.4144011 0.4155112 0.4644528 0.6986843 0.4155112 [8] 0.6986843 0.4088615 0.4144011 0.4644528 0.4644528 0.4644528 0.4644528 [15] 0.4644528 0.4644528 0.4088615 0.6986843 0.6986843 0.4144011 0.6986843 [22] 0.4155112 0.6986843 0.4144011 0.4155112 0.6986843 0.4144011 0.4144011 [29] 0.4644528 1.0345960 0.4144011 0.4644528 0.4088615 0.4088615 0.4155112 [36] 1.0345960 0.4144011 0.4155112 0.4644528 0.4644528 0.4644528 0.4144011 [43] 0.4644528 0.6986843 0.4088615 0.4644528 0.4144011 0.6986843 0.4644528 [50] 1.0345960 0.4644528 0.4088615 0.4155112 0.4644528 0.6986843 0.4144011 [57] 0.4088615 0.4155112 0.4144011 0.4155112 1.0345960 0.4644528 0.4644528 [64] 0.4644528 0.4144011 0.4644528 0.4144011 0.4088615 0.4144011 0.4644528 [71] 0.4644528 0.6986843 0.4644528 > > TD(fit0, Delta = 0.5) [1] 174.1673 > > # with covariates (example where nls and bndnls find different optima) > fit0 <- fitMod(x,y, datset, model="logistic", addCovars = ~age+center, bnds=bnds) > XX <- model.matrix(~center+age, data=datset) > fitnls <- nls(y~cbind(XX, logistic(x, 0, 1, ed50, delta)), + data=datset, start=list(ed50=220, delta=48), algorithm = "plinear") > AIC(fit0) [1] 345.1575 > AIC(fitnls) [1] 345.1575 > summary(fit0) Dose Response Model Model: logistic Fit-type: normal Residuals: Min 1Q Median 3Q Max -6.924 -1.388 -0.179 1.618 5.265 Coefficients with approx. stand. error: Estimate Std. Error e0 -8.98657 1.419 eMax 7.65181 1.269 ed50 286.51988 50.767 delta 43.51040 36.726 age -0.00402 0.011 centergreen -0.12880 0.873 centerred 0.10022 0.975 centersilver 0.60689 0.985 centeryellow 0.06974 0.968 Residual standard error: 2.4 Degrees of freedom: 64 > summary(fitnls) Formula: y ~ cbind(XX, logistic(x, 0, 1, ed50, delta)) Parameters: Estimate Std. Error t value Pr(>|t|) ed50 286.519963 50.768013 5.644 4.08e-07 *** delta 43.510064 36.726739 1.185 0.241 .lin.(Intercept) -8.986562 1.418992 -6.333 2.71e-08 *** .lin.centergreen -0.128797 0.873355 -0.147 0.883 .lin.centerred 0.100221 0.975122 0.103 0.918 .lin.centersilver 0.606894 0.985016 0.616 0.540 .lin.centeryellow 0.069737 0.968243 0.072 0.943 .lin.age -0.004017 0.011024 -0.364 0.717 .lin7 7.651799 1.268713 6.031 8.96e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.396 on 64 degrees of freedom Number of iterations to convergence: 4 Achieved convergence tolerance: 6.656e-06 > > vcov(fit0 ) e0 eMax ed50 delta e0 2.013542598 -1.386381624 4.801326e+01 -3.320465e+01 eMax -1.386381624 1.609637809 -4.594280e+01 3.537786e+01 ed50 48.013263925 -45.942796986 2.577339e+03 -1.719550e+03 delta -33.204646034 35.377861782 -1.719550e+03 1.348832e+03 age -0.006268645 0.001147196 1.238916e-02 -1.182615e-04 centergreen -0.334052153 -0.153718220 1.779756e+00 -1.607538e+00 centerred -0.399667176 -0.068891593 -2.561521e+00 7.131922e-01 centersilver -0.538856175 0.113916607 8.446386e-02 -1.524166e+00 centeryellow -0.463856043 -0.044371048 -3.153773e+00 1.284203e+00 age centergreen centerred centersilver e0 -0.0062686454 -0.3340521534 -0.399667176 -0.5388561747 eMax 0.0011471962 -0.1537182198 -0.068891593 0.1139166068 ed50 0.0123891577 1.7797560819 -2.561520564 0.0844638637 delta -0.0001182615 -1.6075377838 0.713192228 -1.5241663474 age 0.0001215321 -0.0007558322 -0.001348561 -0.0006628626 centergreen -0.0007558322 0.7627491953 0.499187248 0.4609636575 centerred -0.0013485609 0.4991872483 0.950863865 0.4738663247 centersilver -0.0006628626 0.4609636575 0.473866325 0.9702565708 centeryellow -0.0003700776 0.4923423826 0.498378928 0.4677967285 centeryellow e0 -0.4638560434 eMax -0.0443710477 ed50 -3.1537729812 delta 1.2842028644 age -0.0003700776 centergreen 0.4923423826 centerred 0.4983789279 centersilver 0.4677967285 centeryellow 0.9374951281 > vcov(fitnls) ed50 delta .lin.(Intercept) .lin.centergreen ed50 2.577391e+03 -1.719586e+03 48.013675185 1.7797792085 delta -1.719586e+03 1.348853e+03 -33.204886930 -1.6075529969 .lin.(Intercept) 4.801368e+01 -3.320489e+01 2.013538892 -0.3340522689 .lin.centergreen 1.779779e+00 -1.607553e+00 -0.334052269 0.7627491915 .lin.centerred -2.561536e+00 7.132042e-01 -0.399667184 0.4991872439 .lin.centersilver 8.448334e-02 -1.524165e+00 -0.538856203 0.4609636569 .lin.centeryellow -3.153788e+00 1.284211e+00 -0.463855840 0.4923423903 .lin.age 1.238909e-02 -1.181868e-04 -0.006268647 -0.0007558323 .lin7 -4.594320e+01 3.537808e+01 -1.386377258 -0.1537180630 .lin.centerred .lin.centersilver .lin.centeryellow ed50 -2.561536031 0.0844833421 -3.1537878657 delta 0.713204179 -1.5241654679 1.2842107129 .lin.(Intercept) -0.399667184 -0.5388562027 -0.4638558403 .lin.centergreen 0.499187244 0.4609636569 0.4923423903 .lin.centerred 0.950863862 0.4738663195 0.4983789308 .lin.centersilver 0.473866320 0.9702565794 0.4677967413 .lin.centeryellow 0.498378931 0.4677967413 0.9374951277 .lin.age -0.001348561 -0.0006628628 -0.0003700776 .lin7 -0.068891567 0.1139166792 -0.0443712829 .lin.age .lin7 ed50 0.0123890859 -45.943204762 delta -0.0001181868 35.378079613 .lin.(Intercept) -0.0062686471 -1.386377258 .lin.centergreen -0.0007558323 -0.153718063 .lin.centerred -0.0013485609 -0.068891567 .lin.centersilver -0.0006628628 0.113916679 .lin.centeryellow -0.0003700776 -0.044371283 .lin.age 0.0001215321 0.001147198 .lin7 0.0011471982 1.609632577 > > predict(fit0, predType="effect-curve", doseSeq = c(0, 100), se.fit=T) $fit [1] 0.00000000 0.09322688 $se.fit [1] 0.0000000 0.4246053 > > predict(fit0, predType="full-model", se.fit=T, + newdata = data.frame(x = c(0,100), center = as.factor("silver"), age = 5)) $fit [1] -8.389208 -8.295981 $se.fit [1] 1.306647 1.060317 > > TD(fit0, Delta = 0.02) [1] 46.37307 > > ######################################################################## > #### exponential Model > set.seed(4) > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > bnds <- c(0.1, 2)*max(datset$x) > fit0 <- fitMod(x,y, datset, model = "exponential", addCovars = ~1, bnds=bnds) > fitnls <- nls(y~exponential(x, e0, e1, delta), + start=coef(fit0), data=datset) > AIC(fit0) [1] -1501.193 > AIC(fitnls) [1] -1501.193 > summary(fit0) Dose Response Model Model: exponential Fit-type: normal Residuals: Min 1Q Median 3Q Max -2.70e-01 -5.95e-02 7.18e-05 5.87e-02 2.44e-01 Coefficients with approx. stand. error: Estimate Std. Error e0 -0.466 6.03e-03 e1 0.125 9.54e-02 delta 972.943 4.86e+02 Residual standard error: 0.0841 Degrees of freedom: 710 > summary(fitnls) Formula: y ~ exponential(x, e0, e1, delta) Parameters: Estimate Std. Error t value Pr(>|t|) e0 -0.466094 0.006025 -77.359 <2e-16 *** e1 0.124504 0.095374 1.305 0.1922 delta 972.943160 485.901974 2.002 0.0456 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.08415 on 710 degrees of freedom Number of iterations to convergence: 0 Achieved convergence tolerance: 2.866e-08 > > vcov(fit0 ) e0 e1 delta e0 3.630154e-05 -0.0004207859 -2.060286 e1 -4.207859e-04 0.0090961445 46.252664 delta -2.060286e+00 46.2526644930 236100.519975 > vcov(fitnls) e0 e1 delta e0 3.630155e-05 -0.0004207863 -2.060288 e1 -4.207863e-04 0.0090961522 46.252705 delta -2.060288e+00 46.2527045249 236100.728446 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 0.00000000 0.03271671 0.00000000 0.11169230 0.01605388 0.18278309 [7] 0.18278309 0.03271671 0.11169230 0.01605388 0.03271671 0.11169230 [13] 0.11169230 0.01605388 0.18278309 0.18278309 0.18278309 0.18278309 [19] 0.01605388 0.01605388 0.18278309 0.18278309 0.18278309 0.00000000 [25] 0.01605388 0.00000000 0.11169230 0.00000000 0.18278309 0.03271671 [31] 0.18278309 0.01605388 0.00000000 0.03271671 0.00000000 0.03271671 [37] 0.03271671 0.11169230 0.00000000 0.03271671 0.01605388 0.18278309 [43] 0.01605388 0.03271671 0.01605388 0.01605388 0.01605388 0.18278309 [49] 0.01605388 0.01605388 0.01605388 0.01605388 0.01605388 0.01605388 [55] 0.03271671 0.03271671 0.01605388 0.00000000 0.11169230 0.18278309 [61] 0.00000000 0.18278309 0.18278309 0.03271671 0.03271671 0.01605388 [67] 0.00000000 0.03271671 0.18278309 0.01605388 0.03271671 0.00000000 [73] 0.00000000 0.01605388 0.18278309 0.01605388 0.00000000 0.01605388 [79] 0.01605388 0.01605388 0.18278309 0.18278309 0.00000000 0.01605388 [85] 0.11169230 0.11169230 0.01605388 0.18278309 0.11169230 0.03271671 [91] 0.03271671 0.18278309 0.01605388 0.11169230 0.03271671 0.00000000 [97] 0.18278309 0.00000000 0.00000000 0.01605388 0.11169230 0.00000000 [103] 0.11169230 0.03271671 0.11169230 0.18278309 0.01605388 0.00000000 [109] 0.11169230 0.01605388 0.11169230 0.00000000 0.00000000 0.01605388 [115] 0.11169230 0.01605388 0.11169230 0.11169230 0.18278309 0.01605388 [121] 0.11169230 0.18278309 0.00000000 0.03271671 0.18278309 0.01605388 [127] 0.01605388 0.03271671 0.03271671 0.11169230 0.11169230 0.18278309 [133] 0.00000000 0.00000000 0.01605388 0.01605388 0.01605388 0.01605388 [139] 0.01605388 0.18278309 0.18278309 0.01605388 0.00000000 0.18278309 [145] 0.00000000 0.01605388 0.18278309 0.03271671 0.18278309 0.01605388 [151] 0.00000000 0.03271671 0.01605388 0.01605388 0.01605388 0.03271671 [157] 0.01605388 0.01605388 0.00000000 0.11169230 0.00000000 0.00000000 [163] 0.01605388 0.03271671 0.03271671 0.00000000 0.11169230 0.18278309 [169] 0.18278309 0.01605388 0.03271671 0.03271671 0.11169230 0.01605388 [175] 0.01605388 0.03271671 0.03271671 0.00000000 0.01605388 0.01605388 [181] 0.11169230 0.01605388 0.03271671 0.18278309 0.11169230 0.01605388 [187] 0.11169230 0.03271671 0.01605388 0.03271671 0.00000000 0.18278309 [193] 0.03271671 0.03271671 0.01605388 0.01605388 0.01605388 0.11169230 [199] 0.01605388 0.00000000 0.11169230 0.11169230 0.01605388 0.03271671 [205] 0.00000000 0.01605388 0.00000000 0.00000000 0.01605388 0.01605388 [211] 0.01605388 0.03271671 0.01605388 0.03271671 0.01605388 0.18278309 [217] 0.01605388 0.11169230 0.01605388 0.18278309 0.11169230 0.01605388 [223] 0.11169230 0.18278309 0.03271671 0.18278309 0.03271671 0.11169230 [229] 0.11169230 0.00000000 0.01605388 0.01605388 0.11169230 0.00000000 [235] 0.18278309 0.03271671 0.01605388 0.11169230 0.18278309 0.18278309 [241] 0.01605388 0.03271671 0.00000000 0.03271671 0.18278309 0.01605388 [247] 0.01605388 0.03271671 0.01605388 0.11169230 0.03271671 0.03271671 [253] 0.11169230 0.00000000 0.00000000 0.00000000 0.01605388 0.11169230 [259] 0.18278309 0.01605388 0.18278309 0.01605388 0.18278309 0.03271671 [265] 0.01605388 0.03271671 0.01605388 0.18278309 0.18278309 0.03271671 [271] 0.01605388 0.18278309 0.11169230 0.01605388 0.18278309 0.01605388 [277] 0.01605388 0.18278309 0.11169230 0.01605388 0.18278309 0.03271671 [283] 0.18278309 0.01605388 0.00000000 0.01605388 0.01605388 0.01605388 [289] 0.11169230 0.03271671 0.03271671 0.01605388 0.03271671 0.01605388 [295] 0.03271671 0.00000000 0.00000000 0.01605388 0.00000000 0.01605388 [301] 0.11169230 0.11169230 0.18278309 0.11169230 0.01605388 0.01605388 [307] 0.01605388 0.03271671 0.03271671 0.03271671 0.01605388 0.18278309 [313] 0.03271671 0.03271671 0.11169230 0.01605388 0.03271671 0.11169230 [319] 0.03271671 0.11169230 0.03271671 0.01605388 0.01605388 0.01605388 [325] 0.18278309 0.11169230 0.01605388 0.03271671 0.18278309 0.01605388 [331] 0.11169230 0.03271671 0.01605388 0.03271671 0.03271671 0.01605388 [337] 0.01605388 0.11169230 0.01605388 0.03271671 0.01605388 0.01605388 [343] 0.00000000 0.01605388 0.03271671 0.01605388 0.11169230 0.18278309 [349] 0.01605388 0.01605388 0.01605388 0.18278309 0.11169230 0.03271671 [355] 0.18278309 0.01605388 0.11169230 0.03271671 0.03271671 0.01605388 [361] 0.01605388 0.01605388 0.01605388 0.00000000 0.03271671 0.18278309 [367] 0.03271671 0.18278309 0.18278309 0.01605388 0.01605388 0.11169230 [373] 0.01605388 0.11169230 0.01605388 0.18278309 0.18278309 0.01605388 [379] 0.18278309 0.18278309 0.11169230 0.11169230 0.18278309 0.03271671 [385] 0.18278309 0.03271671 0.18278309 0.01605388 0.11169230 0.00000000 [391] 0.01605388 0.00000000 0.00000000 0.01605388 0.01605388 0.03271671 [397] 0.03271671 0.03271671 0.00000000 0.00000000 0.01605388 0.00000000 [403] 0.11169230 0.03271671 0.03271671 0.00000000 0.03271671 0.01605388 [409] 0.01605388 0.18278309 0.03271671 0.01605388 0.03271671 0.11169230 [415] 0.01605388 0.11169230 0.18278309 0.11169230 0.01605388 0.03271671 [421] 0.01605388 0.01605388 0.18278309 0.03271671 0.11169230 0.01605388 [427] 0.03271671 0.00000000 0.18278309 0.01605388 0.11169230 0.01605388 [433] 0.01605388 0.01605388 0.00000000 0.01605388 0.11169230 0.00000000 [439] 0.03271671 0.03271671 0.01605388 0.01605388 0.01605388 0.03271671 [445] 0.00000000 0.00000000 0.01605388 0.01605388 0.00000000 0.03271671 [451] 0.18278309 0.01605388 0.11169230 0.00000000 0.01605388 0.00000000 [457] 0.01605388 0.00000000 0.18278309 0.01605388 0.01605388 0.11169230 [463] 0.01605388 0.03271671 0.18278309 0.18278309 0.11169230 0.18278309 [469] 0.01605388 0.01605388 0.00000000 0.01605388 0.01605388 0.03271671 [475] 0.18278309 0.03271671 0.01605388 0.18278309 0.03271671 0.11169230 [481] 0.00000000 0.01605388 0.18278309 0.03271671 0.01605388 0.03271671 [487] 0.18278309 0.11169230 0.18278309 0.01605388 0.11169230 0.18278309 [493] 0.11169230 0.18278309 0.03271671 0.01605388 0.18278309 0.03271671 [499] 0.03271671 0.01605388 0.18278309 0.11169230 0.18278309 0.18278309 [505] 0.01605388 0.00000000 0.01605388 0.18278309 0.18278309 0.01605388 [511] 0.03271671 0.01605388 0.18278309 0.01605388 0.01605388 0.03271671 [517] 0.01605388 0.01605388 0.03271671 0.00000000 0.03271671 0.03271671 [523] 0.18278309 0.03271671 0.03271671 0.03271671 0.03271671 0.00000000 [529] 0.01605388 0.18278309 0.03271671 0.11169230 0.18278309 0.01605388 [535] 0.01605388 0.01605388 0.01605388 0.11169230 0.18278309 0.00000000 [541] 0.03271671 0.11169230 0.03271671 0.18278309 0.03271671 0.01605388 [547] 0.03271671 0.00000000 0.00000000 0.18278309 0.03271671 0.11169230 [553] 0.11169230 0.01605388 0.00000000 0.03271671 0.00000000 0.01605388 [559] 0.01605388 0.01605388 0.18278309 0.18278309 0.18278309 0.03271671 [565] 0.03271671 0.01605388 0.11169230 0.11169230 0.03271671 0.01605388 [571] 0.11169230 0.00000000 0.00000000 0.01605388 0.00000000 0.01605388 [577] 0.03271671 0.03271671 0.00000000 0.01605388 0.01605388 0.11169230 [583] 0.03271671 0.18278309 0.01605388 0.11169230 0.18278309 0.01605388 [589] 0.01605388 0.01605388 0.18278309 0.01605388 0.18278309 0.01605388 [595] 0.18278309 0.18278309 0.11169230 0.03271671 0.03271671 0.01605388 [601] 0.01605388 0.01605388 0.18278309 0.03271671 0.03271671 0.01605388 [607] 0.01605388 0.18278309 0.18278309 0.11169230 0.03271671 0.18278309 [613] 0.18278309 0.01605388 0.01605388 0.00000000 0.18278309 0.01605388 [619] 0.11169230 0.01605388 0.11169230 0.00000000 0.01605388 0.01605388 [625] 0.18278309 0.01605388 0.03271671 0.03271671 0.00000000 0.00000000 [631] 0.00000000 0.00000000 0.00000000 0.01605388 0.18278309 0.03271671 [637] 0.00000000 0.01605388 0.11169230 0.18278309 0.01605388 0.11169230 [643] 0.01605388 0.00000000 0.01605388 0.03271671 0.03271671 0.01605388 [649] 0.00000000 0.01605388 0.11169230 0.11169230 0.18278309 0.18278309 [655] 0.11169230 0.01605388 0.03271671 0.03271671 0.01605388 0.01605388 [661] 0.00000000 0.01605388 0.03271671 0.11169230 0.01605388 0.01605388 [667] 0.01605388 0.01605388 0.01605388 0.01605388 0.00000000 0.01605388 [673] 0.03271671 0.18278309 0.01605388 0.01605388 0.18278309 0.00000000 [679] 0.03271671 0.01605388 0.18278309 0.03271671 0.11169230 0.01605388 [685] 0.18278309 0.18278309 0.11169230 0.03271671 0.00000000 0.03271671 [691] 0.01605388 0.01605388 0.01605388 0.11169230 0.18278309 0.01605388 [697] 0.01605388 0.01605388 0.01605388 0.01605388 0.01605388 0.01605388 [703] 0.11169230 0.11169230 0.01605388 0.01605388 0.01605388 0.01605388 [709] 0.03271671 0.11169230 0.01605388 0.18278309 0.01605388 $se.fit [1] 0.000000000 0.006873006 0.000000000 0.011203793 0.003837298 0.008771443 [7] 0.008771443 0.006873006 0.011203793 0.003837298 0.006873006 0.011203793 [13] 0.011203793 0.003837298 0.008771443 0.008771443 0.008771443 0.008771443 [19] 0.003837298 0.003837298 0.008771443 0.008771443 0.008771443 0.000000000 [25] 0.003837298 0.000000000 0.011203793 0.000000000 0.008771443 0.006873006 [31] 0.008771443 0.003837298 0.000000000 0.006873006 0.000000000 0.006873006 [37] 0.006873006 0.011203793 0.000000000 0.006873006 0.003837298 0.008771443 [43] 0.003837298 0.006873006 0.003837298 0.003837298 0.003837298 0.008771443 [49] 0.003837298 0.003837298 0.003837298 0.003837298 0.003837298 0.003837298 [55] 0.006873006 0.006873006 0.003837298 0.000000000 0.011203793 0.008771443 [61] 0.000000000 0.008771443 0.008771443 0.006873006 0.006873006 0.003837298 [67] 0.000000000 0.006873006 0.008771443 0.003837298 0.006873006 0.000000000 [73] 0.000000000 0.003837298 0.008771443 0.003837298 0.000000000 0.003837298 [79] 0.003837298 0.003837298 0.008771443 0.008771443 0.000000000 0.003837298 [85] 0.011203793 0.011203793 0.003837298 0.008771443 0.011203793 0.006873006 [91] 0.006873006 0.008771443 0.003837298 0.011203793 0.006873006 0.000000000 [97] 0.008771443 0.000000000 0.000000000 0.003837298 0.011203793 0.000000000 [103] 0.011203793 0.006873006 0.011203793 0.008771443 0.003837298 0.000000000 [109] 0.011203793 0.003837298 0.011203793 0.000000000 0.000000000 0.003837298 [115] 0.011203793 0.003837298 0.011203793 0.011203793 0.008771443 0.003837298 [121] 0.011203793 0.008771443 0.000000000 0.006873006 0.008771443 0.003837298 [127] 0.003837298 0.006873006 0.006873006 0.011203793 0.011203793 0.008771443 [133] 0.000000000 0.000000000 0.003837298 0.003837298 0.003837298 0.003837298 [139] 0.003837298 0.008771443 0.008771443 0.003837298 0.000000000 0.008771443 [145] 0.000000000 0.003837298 0.008771443 0.006873006 0.008771443 0.003837298 [151] 0.000000000 0.006873006 0.003837298 0.003837298 0.003837298 0.006873006 [157] 0.003837298 0.003837298 0.000000000 0.011203793 0.000000000 0.000000000 [163] 0.003837298 0.006873006 0.006873006 0.000000000 0.011203793 0.008771443 [169] 0.008771443 0.003837298 0.006873006 0.006873006 0.011203793 0.003837298 [175] 0.003837298 0.006873006 0.006873006 0.000000000 0.003837298 0.003837298 [181] 0.011203793 0.003837298 0.006873006 0.008771443 0.011203793 0.003837298 [187] 0.011203793 0.006873006 0.003837298 0.006873006 0.000000000 0.008771443 [193] 0.006873006 0.006873006 0.003837298 0.003837298 0.003837298 0.011203793 [199] 0.003837298 0.000000000 0.011203793 0.011203793 0.003837298 0.006873006 [205] 0.000000000 0.003837298 0.000000000 0.000000000 0.003837298 0.003837298 [211] 0.003837298 0.006873006 0.003837298 0.006873006 0.003837298 0.008771443 [217] 0.003837298 0.011203793 0.003837298 0.008771443 0.011203793 0.003837298 [223] 0.011203793 0.008771443 0.006873006 0.008771443 0.006873006 0.011203793 [229] 0.011203793 0.000000000 0.003837298 0.003837298 0.011203793 0.000000000 [235] 0.008771443 0.006873006 0.003837298 0.011203793 0.008771443 0.008771443 [241] 0.003837298 0.006873006 0.000000000 0.006873006 0.008771443 0.003837298 [247] 0.003837298 0.006873006 0.003837298 0.011203793 0.006873006 0.006873006 [253] 0.011203793 0.000000000 0.000000000 0.000000000 0.003837298 0.011203793 [259] 0.008771443 0.003837298 0.008771443 0.003837298 0.008771443 0.006873006 [265] 0.003837298 0.006873006 0.003837298 0.008771443 0.008771443 0.006873006 [271] 0.003837298 0.008771443 0.011203793 0.003837298 0.008771443 0.003837298 [277] 0.003837298 0.008771443 0.011203793 0.003837298 0.008771443 0.006873006 [283] 0.008771443 0.003837298 0.000000000 0.003837298 0.003837298 0.003837298 [289] 0.011203793 0.006873006 0.006873006 0.003837298 0.006873006 0.003837298 [295] 0.006873006 0.000000000 0.000000000 0.003837298 0.000000000 0.003837298 [301] 0.011203793 0.011203793 0.008771443 0.011203793 0.003837298 0.003837298 [307] 0.003837298 0.006873006 0.006873006 0.006873006 0.003837298 0.008771443 [313] 0.006873006 0.006873006 0.011203793 0.003837298 0.006873006 0.011203793 [319] 0.006873006 0.011203793 0.006873006 0.003837298 0.003837298 0.003837298 [325] 0.008771443 0.011203793 0.003837298 0.006873006 0.008771443 0.003837298 [331] 0.011203793 0.006873006 0.003837298 0.006873006 0.006873006 0.003837298 [337] 0.003837298 0.011203793 0.003837298 0.006873006 0.003837298 0.003837298 [343] 0.000000000 0.003837298 0.006873006 0.003837298 0.011203793 0.008771443 [349] 0.003837298 0.003837298 0.003837298 0.008771443 0.011203793 0.006873006 [355] 0.008771443 0.003837298 0.011203793 0.006873006 0.006873006 0.003837298 [361] 0.003837298 0.003837298 0.003837298 0.000000000 0.006873006 0.008771443 [367] 0.006873006 0.008771443 0.008771443 0.003837298 0.003837298 0.011203793 [373] 0.003837298 0.011203793 0.003837298 0.008771443 0.008771443 0.003837298 [379] 0.008771443 0.008771443 0.011203793 0.011203793 0.008771443 0.006873006 [385] 0.008771443 0.006873006 0.008771443 0.003837298 0.011203793 0.000000000 [391] 0.003837298 0.000000000 0.000000000 0.003837298 0.003837298 0.006873006 [397] 0.006873006 0.006873006 0.000000000 0.000000000 0.003837298 0.000000000 [403] 0.011203793 0.006873006 0.006873006 0.000000000 0.006873006 0.003837298 [409] 0.003837298 0.008771443 0.006873006 0.003837298 0.006873006 0.011203793 [415] 0.003837298 0.011203793 0.008771443 0.011203793 0.003837298 0.006873006 [421] 0.003837298 0.003837298 0.008771443 0.006873006 0.011203793 0.003837298 [427] 0.006873006 0.000000000 0.008771443 0.003837298 0.011203793 0.003837298 [433] 0.003837298 0.003837298 0.000000000 0.003837298 0.011203793 0.000000000 [439] 0.006873006 0.006873006 0.003837298 0.003837298 0.003837298 0.006873006 [445] 0.000000000 0.000000000 0.003837298 0.003837298 0.000000000 0.006873006 [451] 0.008771443 0.003837298 0.011203793 0.000000000 0.003837298 0.000000000 [457] 0.003837298 0.000000000 0.008771443 0.003837298 0.003837298 0.011203793 [463] 0.003837298 0.006873006 0.008771443 0.008771443 0.011203793 0.008771443 [469] 0.003837298 0.003837298 0.000000000 0.003837298 0.003837298 0.006873006 [475] 0.008771443 0.006873006 0.003837298 0.008771443 0.006873006 0.011203793 [481] 0.000000000 0.003837298 0.008771443 0.006873006 0.003837298 0.006873006 [487] 0.008771443 0.011203793 0.008771443 0.003837298 0.011203793 0.008771443 [493] 0.011203793 0.008771443 0.006873006 0.003837298 0.008771443 0.006873006 [499] 0.006873006 0.003837298 0.008771443 0.011203793 0.008771443 0.008771443 [505] 0.003837298 0.000000000 0.003837298 0.008771443 0.008771443 0.003837298 [511] 0.006873006 0.003837298 0.008771443 0.003837298 0.003837298 0.006873006 [517] 0.003837298 0.003837298 0.006873006 0.000000000 0.006873006 0.006873006 [523] 0.008771443 0.006873006 0.006873006 0.006873006 0.006873006 0.000000000 [529] 0.003837298 0.008771443 0.006873006 0.011203793 0.008771443 0.003837298 [535] 0.003837298 0.003837298 0.003837298 0.011203793 0.008771443 0.000000000 [541] 0.006873006 0.011203793 0.006873006 0.008771443 0.006873006 0.003837298 [547] 0.006873006 0.000000000 0.000000000 0.008771443 0.006873006 0.011203793 [553] 0.011203793 0.003837298 0.000000000 0.006873006 0.000000000 0.003837298 [559] 0.003837298 0.003837298 0.008771443 0.008771443 0.008771443 0.006873006 [565] 0.006873006 0.003837298 0.011203793 0.011203793 0.006873006 0.003837298 [571] 0.011203793 0.000000000 0.000000000 0.003837298 0.000000000 0.003837298 [577] 0.006873006 0.006873006 0.000000000 0.003837298 0.003837298 0.011203793 [583] 0.006873006 0.008771443 0.003837298 0.011203793 0.008771443 0.003837298 [589] 0.003837298 0.003837298 0.008771443 0.003837298 0.008771443 0.003837298 [595] 0.008771443 0.008771443 0.011203793 0.006873006 0.006873006 0.003837298 [601] 0.003837298 0.003837298 0.008771443 0.006873006 0.006873006 0.003837298 [607] 0.003837298 0.008771443 0.008771443 0.011203793 0.006873006 0.008771443 [613] 0.008771443 0.003837298 0.003837298 0.000000000 0.008771443 0.003837298 [619] 0.011203793 0.003837298 0.011203793 0.000000000 0.003837298 0.003837298 [625] 0.008771443 0.003837298 0.006873006 0.006873006 0.000000000 0.000000000 [631] 0.000000000 0.000000000 0.000000000 0.003837298 0.008771443 0.006873006 [637] 0.000000000 0.003837298 0.011203793 0.008771443 0.003837298 0.011203793 [643] 0.003837298 0.000000000 0.003837298 0.006873006 0.006873006 0.003837298 [649] 0.000000000 0.003837298 0.011203793 0.011203793 0.008771443 0.008771443 [655] 0.011203793 0.003837298 0.006873006 0.006873006 0.003837298 0.003837298 [661] 0.000000000 0.003837298 0.006873006 0.011203793 0.003837298 0.003837298 [667] 0.003837298 0.003837298 0.003837298 0.003837298 0.000000000 0.003837298 [673] 0.006873006 0.008771443 0.003837298 0.003837298 0.008771443 0.000000000 [679] 0.006873006 0.003837298 0.008771443 0.006873006 0.011203793 0.003837298 [685] 0.008771443 0.008771443 0.011203793 0.006873006 0.000000000 0.006873006 [691] 0.003837298 0.003837298 0.003837298 0.011203793 0.008771443 0.003837298 [697] 0.003837298 0.003837298 0.003837298 0.003837298 0.003837298 0.003837298 [703] 0.011203793 0.011203793 0.003837298 0.003837298 0.003837298 0.003837298 [709] 0.006873006 0.011203793 0.003837298 0.008771443 0.003837298 > > predict(fit0, predType="full-model", se.fit=T) $fit [1] -0.4660939 -0.4333772 -0.4660939 -0.3544016 -0.4500400 -0.2833108 [7] -0.2833108 -0.4333772 -0.3544016 -0.4500400 -0.4333772 -0.3544016 [13] -0.3544016 -0.4500400 -0.2833108 -0.2833108 -0.2833108 -0.2833108 [19] -0.4500400 -0.4500400 -0.2833108 -0.2833108 -0.2833108 -0.4660939 [25] -0.4500400 -0.4660939 -0.3544016 -0.4660939 -0.2833108 -0.4333772 [31] -0.2833108 -0.4500400 -0.4660939 -0.4333772 -0.4660939 -0.4333772 [37] -0.4333772 -0.3544016 -0.4660939 -0.4333772 -0.4500400 -0.2833108 [43] -0.4500400 -0.4333772 -0.4500400 -0.4500400 -0.4500400 -0.2833108 [49] -0.4500400 -0.4500400 -0.4500400 -0.4500400 -0.4500400 -0.4500400 [55] -0.4333772 -0.4333772 -0.4500400 -0.4660939 -0.3544016 -0.2833108 [61] -0.4660939 -0.2833108 -0.2833108 -0.4333772 -0.4333772 -0.4500400 [67] -0.4660939 -0.4333772 -0.2833108 -0.4500400 -0.4333772 -0.4660939 [73] -0.4660939 -0.4500400 -0.2833108 -0.4500400 -0.4660939 -0.4500400 [79] -0.4500400 -0.4500400 -0.2833108 -0.2833108 -0.4660939 -0.4500400 [85] -0.3544016 -0.3544016 -0.4500400 -0.2833108 -0.3544016 -0.4333772 [91] -0.4333772 -0.2833108 -0.4500400 -0.3544016 -0.4333772 -0.4660939 [97] -0.2833108 -0.4660939 -0.4660939 -0.4500400 -0.3544016 -0.4660939 [103] -0.3544016 -0.4333772 -0.3544016 -0.2833108 -0.4500400 -0.4660939 [109] -0.3544016 -0.4500400 -0.3544016 -0.4660939 -0.4660939 -0.4500400 [115] -0.3544016 -0.4500400 -0.3544016 -0.3544016 -0.2833108 -0.4500400 [121] -0.3544016 -0.2833108 -0.4660939 -0.4333772 -0.2833108 -0.4500400 [127] -0.4500400 -0.4333772 -0.4333772 -0.3544016 -0.3544016 -0.2833108 [133] -0.4660939 -0.4660939 -0.4500400 -0.4500400 -0.4500400 -0.4500400 [139] -0.4500400 -0.2833108 -0.2833108 -0.4500400 -0.4660939 -0.2833108 [145] -0.4660939 -0.4500400 -0.2833108 -0.4333772 -0.2833108 -0.4500400 [151] -0.4660939 -0.4333772 -0.4500400 -0.4500400 -0.4500400 -0.4333772 [157] -0.4500400 -0.4500400 -0.4660939 -0.3544016 -0.4660939 -0.4660939 [163] -0.4500400 -0.4333772 -0.4333772 -0.4660939 -0.3544016 -0.2833108 [169] -0.2833108 -0.4500400 -0.4333772 -0.4333772 -0.3544016 -0.4500400 [175] -0.4500400 -0.4333772 -0.4333772 -0.4660939 -0.4500400 -0.4500400 [181] -0.3544016 -0.4500400 -0.4333772 -0.2833108 -0.3544016 -0.4500400 [187] -0.3544016 -0.4333772 -0.4500400 -0.4333772 -0.4660939 -0.2833108 [193] -0.4333772 -0.4333772 -0.4500400 -0.4500400 -0.4500400 -0.3544016 [199] -0.4500400 -0.4660939 -0.3544016 -0.3544016 -0.4500400 -0.4333772 [205] -0.4660939 -0.4500400 -0.4660939 -0.4660939 -0.4500400 -0.4500400 [211] -0.4500400 -0.4333772 -0.4500400 -0.4333772 -0.4500400 -0.2833108 [217] -0.4500400 -0.3544016 -0.4500400 -0.2833108 -0.3544016 -0.4500400 [223] -0.3544016 -0.2833108 -0.4333772 -0.2833108 -0.4333772 -0.3544016 [229] -0.3544016 -0.4660939 -0.4500400 -0.4500400 -0.3544016 -0.4660939 [235] -0.2833108 -0.4333772 -0.4500400 -0.3544016 -0.2833108 -0.2833108 [241] -0.4500400 -0.4333772 -0.4660939 -0.4333772 -0.2833108 -0.4500400 [247] -0.4500400 -0.4333772 -0.4500400 -0.3544016 -0.4333772 -0.4333772 [253] -0.3544016 -0.4660939 -0.4660939 -0.4660939 -0.4500400 -0.3544016 [259] -0.2833108 -0.4500400 -0.2833108 -0.4500400 -0.2833108 -0.4333772 [265] -0.4500400 -0.4333772 -0.4500400 -0.2833108 -0.2833108 -0.4333772 [271] -0.4500400 -0.2833108 -0.3544016 -0.4500400 -0.2833108 -0.4500400 [277] -0.4500400 -0.2833108 -0.3544016 -0.4500400 -0.2833108 -0.4333772 [283] -0.2833108 -0.4500400 -0.4660939 -0.4500400 -0.4500400 -0.4500400 [289] -0.3544016 -0.4333772 -0.4333772 -0.4500400 -0.4333772 -0.4500400 [295] -0.4333772 -0.4660939 -0.4660939 -0.4500400 -0.4660939 -0.4500400 [301] -0.3544016 -0.3544016 -0.2833108 -0.3544016 -0.4500400 -0.4500400 [307] -0.4500400 -0.4333772 -0.4333772 -0.4333772 -0.4500400 -0.2833108 [313] -0.4333772 -0.4333772 -0.3544016 -0.4500400 -0.4333772 -0.3544016 [319] -0.4333772 -0.3544016 -0.4333772 -0.4500400 -0.4500400 -0.4500400 [325] -0.2833108 -0.3544016 -0.4500400 -0.4333772 -0.2833108 -0.4500400 [331] -0.3544016 -0.4333772 -0.4500400 -0.4333772 -0.4333772 -0.4500400 [337] -0.4500400 -0.3544016 -0.4500400 -0.4333772 -0.4500400 -0.4500400 [343] -0.4660939 -0.4500400 -0.4333772 -0.4500400 -0.3544016 -0.2833108 [349] -0.4500400 -0.4500400 -0.4500400 -0.2833108 -0.3544016 -0.4333772 [355] -0.2833108 -0.4500400 -0.3544016 -0.4333772 -0.4333772 -0.4500400 [361] -0.4500400 -0.4500400 -0.4500400 -0.4660939 -0.4333772 -0.2833108 [367] -0.4333772 -0.2833108 -0.2833108 -0.4500400 -0.4500400 -0.3544016 [373] -0.4500400 -0.3544016 -0.4500400 -0.2833108 -0.2833108 -0.4500400 [379] -0.2833108 -0.2833108 -0.3544016 -0.3544016 -0.2833108 -0.4333772 [385] -0.2833108 -0.4333772 -0.2833108 -0.4500400 -0.3544016 -0.4660939 [391] -0.4500400 -0.4660939 -0.4660939 -0.4500400 -0.4500400 -0.4333772 [397] -0.4333772 -0.4333772 -0.4660939 -0.4660939 -0.4500400 -0.4660939 [403] -0.3544016 -0.4333772 -0.4333772 -0.4660939 -0.4333772 -0.4500400 [409] -0.4500400 -0.2833108 -0.4333772 -0.4500400 -0.4333772 -0.3544016 [415] -0.4500400 -0.3544016 -0.2833108 -0.3544016 -0.4500400 -0.4333772 [421] -0.4500400 -0.4500400 -0.2833108 -0.4333772 -0.3544016 -0.4500400 [427] -0.4333772 -0.4660939 -0.2833108 -0.4500400 -0.3544016 -0.4500400 [433] -0.4500400 -0.4500400 -0.4660939 -0.4500400 -0.3544016 -0.4660939 [439] -0.4333772 -0.4333772 -0.4500400 -0.4500400 -0.4500400 -0.4333772 [445] -0.4660939 -0.4660939 -0.4500400 -0.4500400 -0.4660939 -0.4333772 [451] -0.2833108 -0.4500400 -0.3544016 -0.4660939 -0.4500400 -0.4660939 [457] -0.4500400 -0.4660939 -0.2833108 -0.4500400 -0.4500400 -0.3544016 [463] -0.4500400 -0.4333772 -0.2833108 -0.2833108 -0.3544016 -0.2833108 [469] -0.4500400 -0.4500400 -0.4660939 -0.4500400 -0.4500400 -0.4333772 [475] -0.2833108 -0.4333772 -0.4500400 -0.2833108 -0.4333772 -0.3544016 [481] -0.4660939 -0.4500400 -0.2833108 -0.4333772 -0.4500400 -0.4333772 [487] -0.2833108 -0.3544016 -0.2833108 -0.4500400 -0.3544016 -0.2833108 [493] -0.3544016 -0.2833108 -0.4333772 -0.4500400 -0.2833108 -0.4333772 [499] -0.4333772 -0.4500400 -0.2833108 -0.3544016 -0.2833108 -0.2833108 [505] -0.4500400 -0.4660939 -0.4500400 -0.2833108 -0.2833108 -0.4500400 [511] -0.4333772 -0.4500400 -0.2833108 -0.4500400 -0.4500400 -0.4333772 [517] -0.4500400 -0.4500400 -0.4333772 -0.4660939 -0.4333772 -0.4333772 [523] -0.2833108 -0.4333772 -0.4333772 -0.4333772 -0.4333772 -0.4660939 [529] -0.4500400 -0.2833108 -0.4333772 -0.3544016 -0.2833108 -0.4500400 [535] -0.4500400 -0.4500400 -0.4500400 -0.3544016 -0.2833108 -0.4660939 [541] -0.4333772 -0.3544016 -0.4333772 -0.2833108 -0.4333772 -0.4500400 [547] -0.4333772 -0.4660939 -0.4660939 -0.2833108 -0.4333772 -0.3544016 [553] -0.3544016 -0.4500400 -0.4660939 -0.4333772 -0.4660939 -0.4500400 [559] -0.4500400 -0.4500400 -0.2833108 -0.2833108 -0.2833108 -0.4333772 [565] -0.4333772 -0.4500400 -0.3544016 -0.3544016 -0.4333772 -0.4500400 [571] -0.3544016 -0.4660939 -0.4660939 -0.4500400 -0.4660939 -0.4500400 [577] -0.4333772 -0.4333772 -0.4660939 -0.4500400 -0.4500400 -0.3544016 [583] -0.4333772 -0.2833108 -0.4500400 -0.3544016 -0.2833108 -0.4500400 [589] -0.4500400 -0.4500400 -0.2833108 -0.4500400 -0.2833108 -0.4500400 [595] -0.2833108 -0.2833108 -0.3544016 -0.4333772 -0.4333772 -0.4500400 [601] -0.4500400 -0.4500400 -0.2833108 -0.4333772 -0.4333772 -0.4500400 [607] -0.4500400 -0.2833108 -0.2833108 -0.3544016 -0.4333772 -0.2833108 [613] -0.2833108 -0.4500400 -0.4500400 -0.4660939 -0.2833108 -0.4500400 [619] -0.3544016 -0.4500400 -0.3544016 -0.4660939 -0.4500400 -0.4500400 [625] -0.2833108 -0.4500400 -0.4333772 -0.4333772 -0.4660939 -0.4660939 [631] -0.4660939 -0.4660939 -0.4660939 -0.4500400 -0.2833108 -0.4333772 [637] -0.4660939 -0.4500400 -0.3544016 -0.2833108 -0.4500400 -0.3544016 [643] -0.4500400 -0.4660939 -0.4500400 -0.4333772 -0.4333772 -0.4500400 [649] -0.4660939 -0.4500400 -0.3544016 -0.3544016 -0.2833108 -0.2833108 [655] -0.3544016 -0.4500400 -0.4333772 -0.4333772 -0.4500400 -0.4500400 [661] -0.4660939 -0.4500400 -0.4333772 -0.3544016 -0.4500400 -0.4500400 [667] -0.4500400 -0.4500400 -0.4500400 -0.4500400 -0.4660939 -0.4500400 [673] -0.4333772 -0.2833108 -0.4500400 -0.4500400 -0.2833108 -0.4660939 [679] -0.4333772 -0.4500400 -0.2833108 -0.4333772 -0.3544016 -0.4500400 [685] -0.2833108 -0.2833108 -0.3544016 -0.4333772 -0.4660939 -0.4333772 [691] -0.4500400 -0.4500400 -0.4500400 -0.3544016 -0.2833108 -0.4500400 [697] -0.4500400 -0.4500400 -0.4500400 -0.4500400 -0.4500400 -0.4500400 [703] -0.3544016 -0.3544016 -0.4500400 -0.4500400 -0.4500400 -0.4500400 [709] -0.4333772 -0.3544016 -0.4500400 -0.2833108 -0.4500400 $se.fit [1] 0.006025076 0.004212735 0.006025076 0.006884091 0.003835233 0.007313632 [7] 0.007313632 0.004212735 0.006884091 0.003835233 0.004212735 0.006884091 [13] 0.006884091 0.003835233 0.007313632 0.007313632 0.007313632 0.007313632 [19] 0.003835233 0.003835233 0.007313632 0.007313632 0.007313632 0.006025076 [25] 0.003835233 0.006025076 0.006884091 0.006025076 0.007313632 0.004212735 [31] 0.007313632 0.003835233 0.006025076 0.004212735 0.006025076 0.004212735 [37] 0.004212735 0.006884091 0.006025076 0.004212735 0.003835233 0.007313632 [43] 0.003835233 0.004212735 0.003835233 0.003835233 0.003835233 0.007313632 [49] 0.003835233 0.003835233 0.003835233 0.003835233 0.003835233 0.003835233 [55] 0.004212735 0.004212735 0.003835233 0.006025076 0.006884091 0.007313632 [61] 0.006025076 0.007313632 0.007313632 0.004212735 0.004212735 0.003835233 [67] 0.006025076 0.004212735 0.007313632 0.003835233 0.004212735 0.006025076 [73] 0.006025076 0.003835233 0.007313632 0.003835233 0.006025076 0.003835233 [79] 0.003835233 0.003835233 0.007313632 0.007313632 0.006025076 0.003835233 [85] 0.006884091 0.006884091 0.003835233 0.007313632 0.006884091 0.004212735 [91] 0.004212735 0.007313632 0.003835233 0.006884091 0.004212735 0.006025076 [97] 0.007313632 0.006025076 0.006025076 0.003835233 0.006884091 0.006025076 [103] 0.006884091 0.004212735 0.006884091 0.007313632 0.003835233 0.006025076 [109] 0.006884091 0.003835233 0.006884091 0.006025076 0.006025076 0.003835233 [115] 0.006884091 0.003835233 0.006884091 0.006884091 0.007313632 0.003835233 [121] 0.006884091 0.007313632 0.006025076 0.004212735 0.007313632 0.003835233 [127] 0.003835233 0.004212735 0.004212735 0.006884091 0.006884091 0.007313632 [133] 0.006025076 0.006025076 0.003835233 0.003835233 0.003835233 0.003835233 [139] 0.003835233 0.007313632 0.007313632 0.003835233 0.006025076 0.007313632 [145] 0.006025076 0.003835233 0.007313632 0.004212735 0.007313632 0.003835233 [151] 0.006025076 0.004212735 0.003835233 0.003835233 0.003835233 0.004212735 [157] 0.003835233 0.003835233 0.006025076 0.006884091 0.006025076 0.006025076 [163] 0.003835233 0.004212735 0.004212735 0.006025076 0.006884091 0.007313632 [169] 0.007313632 0.003835233 0.004212735 0.004212735 0.006884091 0.003835233 [175] 0.003835233 0.004212735 0.004212735 0.006025076 0.003835233 0.003835233 [181] 0.006884091 0.003835233 0.004212735 0.007313632 0.006884091 0.003835233 [187] 0.006884091 0.004212735 0.003835233 0.004212735 0.006025076 0.007313632 [193] 0.004212735 0.004212735 0.003835233 0.003835233 0.003835233 0.006884091 [199] 0.003835233 0.006025076 0.006884091 0.006884091 0.003835233 0.004212735 [205] 0.006025076 0.003835233 0.006025076 0.006025076 0.003835233 0.003835233 [211] 0.003835233 0.004212735 0.003835233 0.004212735 0.003835233 0.007313632 [217] 0.003835233 0.006884091 0.003835233 0.007313632 0.006884091 0.003835233 [223] 0.006884091 0.007313632 0.004212735 0.007313632 0.004212735 0.006884091 [229] 0.006884091 0.006025076 0.003835233 0.003835233 0.006884091 0.006025076 [235] 0.007313632 0.004212735 0.003835233 0.006884091 0.007313632 0.007313632 [241] 0.003835233 0.004212735 0.006025076 0.004212735 0.007313632 0.003835233 [247] 0.003835233 0.004212735 0.003835233 0.006884091 0.004212735 0.004212735 [253] 0.006884091 0.006025076 0.006025076 0.006025076 0.003835233 0.006884091 [259] 0.007313632 0.003835233 0.007313632 0.003835233 0.007313632 0.004212735 [265] 0.003835233 0.004212735 0.003835233 0.007313632 0.007313632 0.004212735 [271] 0.003835233 0.007313632 0.006884091 0.003835233 0.007313632 0.003835233 [277] 0.003835233 0.007313632 0.006884091 0.003835233 0.007313632 0.004212735 [283] 0.007313632 0.003835233 0.006025076 0.003835233 0.003835233 0.003835233 [289] 0.006884091 0.004212735 0.004212735 0.003835233 0.004212735 0.003835233 [295] 0.004212735 0.006025076 0.006025076 0.003835233 0.006025076 0.003835233 [301] 0.006884091 0.006884091 0.007313632 0.006884091 0.003835233 0.003835233 [307] 0.003835233 0.004212735 0.004212735 0.004212735 0.003835233 0.007313632 [313] 0.004212735 0.004212735 0.006884091 0.003835233 0.004212735 0.006884091 [319] 0.004212735 0.006884091 0.004212735 0.003835233 0.003835233 0.003835233 [325] 0.007313632 0.006884091 0.003835233 0.004212735 0.007313632 0.003835233 [331] 0.006884091 0.004212735 0.003835233 0.004212735 0.004212735 0.003835233 [337] 0.003835233 0.006884091 0.003835233 0.004212735 0.003835233 0.003835233 [343] 0.006025076 0.003835233 0.004212735 0.003835233 0.006884091 0.007313632 [349] 0.003835233 0.003835233 0.003835233 0.007313632 0.006884091 0.004212735 [355] 0.007313632 0.003835233 0.006884091 0.004212735 0.004212735 0.003835233 [361] 0.003835233 0.003835233 0.003835233 0.006025076 0.004212735 0.007313632 [367] 0.004212735 0.007313632 0.007313632 0.003835233 0.003835233 0.006884091 [373] 0.003835233 0.006884091 0.003835233 0.007313632 0.007313632 0.003835233 [379] 0.007313632 0.007313632 0.006884091 0.006884091 0.007313632 0.004212735 [385] 0.007313632 0.004212735 0.007313632 0.003835233 0.006884091 0.006025076 [391] 0.003835233 0.006025076 0.006025076 0.003835233 0.003835233 0.004212735 [397] 0.004212735 0.004212735 0.006025076 0.006025076 0.003835233 0.006025076 [403] 0.006884091 0.004212735 0.004212735 0.006025076 0.004212735 0.003835233 [409] 0.003835233 0.007313632 0.004212735 0.003835233 0.004212735 0.006884091 [415] 0.003835233 0.006884091 0.007313632 0.006884091 0.003835233 0.004212735 [421] 0.003835233 0.003835233 0.007313632 0.004212735 0.006884091 0.003835233 [427] 0.004212735 0.006025076 0.007313632 0.003835233 0.006884091 0.003835233 [433] 0.003835233 0.003835233 0.006025076 0.003835233 0.006884091 0.006025076 [439] 0.004212735 0.004212735 0.003835233 0.003835233 0.003835233 0.004212735 [445] 0.006025076 0.006025076 0.003835233 0.003835233 0.006025076 0.004212735 [451] 0.007313632 0.003835233 0.006884091 0.006025076 0.003835233 0.006025076 [457] 0.003835233 0.006025076 0.007313632 0.003835233 0.003835233 0.006884091 [463] 0.003835233 0.004212735 0.007313632 0.007313632 0.006884091 0.007313632 [469] 0.003835233 0.003835233 0.006025076 0.003835233 0.003835233 0.004212735 [475] 0.007313632 0.004212735 0.003835233 0.007313632 0.004212735 0.006884091 [481] 0.006025076 0.003835233 0.007313632 0.004212735 0.003835233 0.004212735 [487] 0.007313632 0.006884091 0.007313632 0.003835233 0.006884091 0.007313632 [493] 0.006884091 0.007313632 0.004212735 0.003835233 0.007313632 0.004212735 [499] 0.004212735 0.003835233 0.007313632 0.006884091 0.007313632 0.007313632 [505] 0.003835233 0.006025076 0.003835233 0.007313632 0.007313632 0.003835233 [511] 0.004212735 0.003835233 0.007313632 0.003835233 0.003835233 0.004212735 [517] 0.003835233 0.003835233 0.004212735 0.006025076 0.004212735 0.004212735 [523] 0.007313632 0.004212735 0.004212735 0.004212735 0.004212735 0.006025076 [529] 0.003835233 0.007313632 0.004212735 0.006884091 0.007313632 0.003835233 [535] 0.003835233 0.003835233 0.003835233 0.006884091 0.007313632 0.006025076 [541] 0.004212735 0.006884091 0.004212735 0.007313632 0.004212735 0.003835233 [547] 0.004212735 0.006025076 0.006025076 0.007313632 0.004212735 0.006884091 [553] 0.006884091 0.003835233 0.006025076 0.004212735 0.006025076 0.003835233 [559] 0.003835233 0.003835233 0.007313632 0.007313632 0.007313632 0.004212735 [565] 0.004212735 0.003835233 0.006884091 0.006884091 0.004212735 0.003835233 [571] 0.006884091 0.006025076 0.006025076 0.003835233 0.006025076 0.003835233 [577] 0.004212735 0.004212735 0.006025076 0.003835233 0.003835233 0.006884091 [583] 0.004212735 0.007313632 0.003835233 0.006884091 0.007313632 0.003835233 [589] 0.003835233 0.003835233 0.007313632 0.003835233 0.007313632 0.003835233 [595] 0.007313632 0.007313632 0.006884091 0.004212735 0.004212735 0.003835233 [601] 0.003835233 0.003835233 0.007313632 0.004212735 0.004212735 0.003835233 [607] 0.003835233 0.007313632 0.007313632 0.006884091 0.004212735 0.007313632 [613] 0.007313632 0.003835233 0.003835233 0.006025076 0.007313632 0.003835233 [619] 0.006884091 0.003835233 0.006884091 0.006025076 0.003835233 0.003835233 [625] 0.007313632 0.003835233 0.004212735 0.004212735 0.006025076 0.006025076 [631] 0.006025076 0.006025076 0.006025076 0.003835233 0.007313632 0.004212735 [637] 0.006025076 0.003835233 0.006884091 0.007313632 0.003835233 0.006884091 [643] 0.003835233 0.006025076 0.003835233 0.004212735 0.004212735 0.003835233 [649] 0.006025076 0.003835233 0.006884091 0.006884091 0.007313632 0.007313632 [655] 0.006884091 0.003835233 0.004212735 0.004212735 0.003835233 0.003835233 [661] 0.006025076 0.003835233 0.004212735 0.006884091 0.003835233 0.003835233 [667] 0.003835233 0.003835233 0.003835233 0.003835233 0.006025076 0.003835233 [673] 0.004212735 0.007313632 0.003835233 0.003835233 0.007313632 0.006025076 [679] 0.004212735 0.003835233 0.007313632 0.004212735 0.006884091 0.003835233 [685] 0.007313632 0.007313632 0.006884091 0.004212735 0.006025076 0.004212735 [691] 0.003835233 0.003835233 0.003835233 0.006884091 0.007313632 0.003835233 [697] 0.003835233 0.003835233 0.003835233 0.003835233 0.003835233 0.003835233 [703] 0.006884091 0.006884091 0.003835233 0.003835233 0.003835233 0.003835233 [709] 0.004212735 0.006884091 0.003835233 0.007313632 0.003835233 > > TD(fit0, Delta = 0.1) [1] 573.604 > > # with covariates > bnds <- c(0.1, 2)*max(datset$x) > fit0 <- fitMod(x,y, datset, model = "exponential", addCovars = ~age+center, + bnds=bnds) > XX <- model.matrix(~center+age, data=datset) > fitnls <- nls(y~cbind(XX, exponential(x, 0, 1, delta)), + data=datset, start=c(delta=450), algorithm = "plinear") > AIC(fit0) [1] -1502.21 > AIC(fitnls) [1] -1502.21 > summary(fit0) Dose Response Model Model: exponential Fit-type: normal Residuals: Min 1Q Median 3Q Max -2.72e-01 -5.96e-02 -5.44e-06 5.59e-02 2.43e-01 Coefficients with approx. stand. error: Estimate Std. Error e0 -4.57e-01 1.03e-02 e1 1.24e-01 9.45e-02 delta 9.69e+02 4.79e+02 age -2.46e-04 1.09e-04 centergreen -2.26e-03 9.93e-03 centerred 7.10e-03 9.88e-03 centersilver 1.68e-02 1.02e-02 centeryellow -4.45e-03 1.01e-02 Residual standard error: 0.0838 Degrees of freedom: 705 > summary(fitnls) Formula: y ~ cbind(XX, exponential(x, 0, 1, delta)) Parameters: Estimate Std. Error t value Pr(>|t|) delta 9.692e+02 4.795e+02 2.021 0.0436 * .lin.(Intercept) -4.574e-01 1.035e-02 -44.200 <2e-16 *** .lin.centergreen -2.256e-03 9.934e-03 -0.227 0.8204 .lin.centerred 7.104e-03 9.875e-03 0.719 0.4721 .lin.centersilver 1.682e-02 1.018e-02 1.652 0.0989 . .lin.centeryellow -4.446e-03 1.005e-02 -0.442 0.6584 .lin.age -2.463e-04 1.090e-04 -2.259 0.0242 * .lin7 1.244e-01 9.455e-02 1.316 0.1886 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.0838 on 705 degrees of freedom Number of iterations to convergence: 7 Achieved convergence tolerance: 8.761e-06 > > vcov(fit0 ) e0 e1 delta age e0 1.070950e-04 -3.644584e-04 -1.760351e+00 -6.235809e-07 e1 -3.644584e-04 8.939486e-03 4.524835e+01 -1.892276e-07 delta -1.760351e+00 4.524835e+01 2.299191e+05 -9.417516e-04 age -6.235809e-07 -1.892276e-07 -9.417516e-04 1.188604e-08 centergreen -4.990019e-05 -7.223389e-05 -3.668153e-01 4.308966e-08 centerred -5.090480e-05 -5.257813e-05 -2.765207e-01 2.992730e-08 centersilver -5.269569e-05 -5.104405e-05 -2.725147e-01 5.557593e-08 centeryellow -5.416568e-05 -3.395837e-05 -1.820279e-01 7.695026e-08 centergreen centerred centersilver centeryellow e0 -4.990019e-05 -5.090480e-05 -5.269569e-05 -5.416568e-05 e1 -7.223389e-05 -5.257813e-05 -5.104405e-05 -3.395837e-05 delta -3.668153e-01 -2.765207e-01 -2.725147e-01 -1.820279e-01 age 4.308966e-08 2.992730e-08 5.557593e-08 7.695026e-08 centergreen 9.869293e-05 5.105736e-05 5.114013e-05 5.107251e-05 centerred 5.105736e-05 9.752101e-05 5.111632e-05 5.102188e-05 centersilver 5.114013e-05 5.111632e-05 1.036881e-04 5.122455e-05 centeryellow 5.107251e-05 5.102188e-05 5.122455e-05 1.010538e-04 > vcov(fitnls) delta .lin.(Intercept) .lin.centergreen delta 2.299104e+05 -1.760315e+00 -3.668084e-01 .lin.(Intercept) -1.760315e+00 1.070949e-04 -4.990020e-05 .lin.centergreen -3.668084e-01 -4.990020e-05 9.869293e-05 .lin.centerred -2.765154e-01 -5.090480e-05 5.105736e-05 .lin.centersilver -2.725097e-01 -5.269570e-05 5.114013e-05 .lin.centeryellow -1.820244e-01 -5.416569e-05 5.107251e-05 .lin.age -9.417341e-04 -6.235810e-07 4.308966e-08 .lin7 4.524658e+01 -3.644504e-04 -7.223243e-05 .lin.centerred .lin.centersilver .lin.centeryellow delta -2.765154e-01 -2.725097e-01 -1.820244e-01 .lin.(Intercept) -5.090480e-05 -5.269570e-05 -5.416569e-05 .lin.centergreen 5.105736e-05 5.114013e-05 5.107251e-05 .lin.centerred 9.752101e-05 5.111632e-05 5.102188e-05 .lin.centersilver 5.111632e-05 1.036881e-04 5.122455e-05 .lin.centeryellow 5.102188e-05 5.122455e-05 1.010538e-04 .lin.age 2.992730e-08 5.557593e-08 7.695026e-08 .lin7 -5.257703e-05 -5.104303e-05 -3.395768e-05 .lin.age .lin7 delta -9.417341e-04 4.524658e+01 .lin.(Intercept) -6.235810e-07 -3.644504e-04 .lin.centergreen 4.308966e-08 -7.223243e-05 .lin.centerred 2.992730e-08 -5.257703e-05 .lin.centersilver 5.557593e-08 -5.104303e-05 .lin.centeryellow 7.695026e-08 -3.395768e-05 .lin.age 1.188604e-08 -1.892238e-07 .lin7 -1.892238e-07 8.939124e-03 > > predict(fit0, predType="effect-curve", doseSeq = c(0, 100), se.fit=T) $fit [1] 0.00000000 0.01352276 $se.fit [1] 0.000000000 0.003277925 > > predict(fit0, predType="full-model", se.fit=T, + newdata = data.frame(x = c(0,100), center = as.factor("blue"), age = 50)) $fit [1] -0.4697265 -0.4562037 $se.fit [1] 0.008628557 0.007549824 > > TD(fit0, Delta = 0.1) [1] 571.7033 > > ######################################################################## > #### linear model > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > fit0 <- fitMod(x,y, datset, model = "linear", addCovars = ~1) > fitlm <- lm(y~x, data=datset) > AIC(fit0) [1] 4189.744 > AIC(fitlm) [1] 4189.744 > summary(fit0) Dose Response Model Model: linear Fit-type: normal Residuals: Min 1Q Median 3Q Max -20.3923 -4.1973 -0.0226 3.8448 25.3694 Coefficients with approx. stand. error: Estimate Std. Error e0 -11.2122 0.393654 delta 0.0136 0.000531 Residual standard error: 6.43 Degrees of freedom: 636 > summary(fitlm) Call: lm(formula = y ~ x, data = datset) Residuals: Min 1Q Median 3Q Max -25.3694 -3.8448 0.0226 4.1973 20.3923 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.121e+01 3.937e-01 -28.48 <2e-16 *** x 1.358e-02 5.313e-04 25.57 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.433 on 636 degrees of freedom Multiple R-squared: 0.5069, Adjusted R-squared: 0.5061 F-statistic: 653.7 on 1 and 636 DF, p-value: < 2.2e-16 > > vcov(fit0 ) e0 delta e0 0.1549638101 -1.594693e-04 delta -0.0001594693 2.822434e-07 > vcov(fitlm) (Intercept) x (Intercept) 0.1549638101 -1.594693e-04 x -0.0001594693 2.822434e-07 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 3.382287 6.560821 12.605469 12.605469 17.251020 0.000000 0.000000 [8] 6.560821 17.251020 3.382287 15.892672 3.382287 0.000000 9.671438 [15] 15.892672 17.251020 12.605469 17.251020 3.382287 17.251020 17.251020 [22] 9.671438 3.382287 12.605469 0.000000 12.605469 3.382287 6.560821 [29] 0.000000 17.251020 0.000000 9.671438 12.605469 3.382287 3.382287 [36] 0.000000 0.000000 12.605469 0.000000 12.605469 0.000000 15.892672 [43] 12.605469 15.892672 3.382287 17.251020 17.251020 6.560821 3.382287 [50] 0.000000 9.671438 17.251020 15.892672 0.000000 3.382287 17.251020 [57] 6.560821 17.251020 0.000000 3.382287 12.605469 12.605469 0.000000 [64] 0.000000 15.892672 15.892672 0.000000 12.605469 15.892672 3.382287 [71] 15.892672 6.560821 3.382287 17.251020 12.605469 0.000000 12.605469 [78] 12.605469 3.382287 0.000000 0.000000 0.000000 3.382287 3.382287 [85] 3.382287 6.560821 3.382287 0.000000 3.382287 17.251020 6.560821 [92] 3.382287 17.251020 9.671438 3.382287 0.000000 3.382287 3.382287 [99] 12.605469 0.000000 3.382287 3.382287 12.605469 0.000000 0.000000 [106] 17.251020 0.000000 6.560821 15.892672 17.251020 3.382287 17.251020 [113] 3.382287 0.000000 0.000000 3.382287 6.560821 0.000000 6.560821 [120] 3.382287 0.000000 0.000000 6.560821 15.892672 12.605469 12.605469 [127] 0.000000 17.251020 0.000000 17.251020 3.382287 0.000000 12.605469 [134] 17.251020 0.000000 3.382287 0.000000 6.560821 6.560821 6.560821 [141] 3.382287 17.251020 0.000000 0.000000 3.382287 0.000000 15.892672 [148] 17.251020 3.382287 15.892672 0.000000 17.251020 6.560821 3.382287 [155] 12.605469 6.560821 6.560821 3.382287 3.382287 0.000000 3.382287 [162] 0.000000 3.382287 12.605469 3.382287 0.000000 17.251020 0.000000 [169] 0.000000 3.382287 17.251020 3.382287 17.251020 15.892672 6.560821 [176] 12.605469 3.382287 0.000000 12.605469 0.000000 12.605469 17.251020 [183] 12.605469 0.000000 0.000000 12.605469 3.382287 12.605469 17.251020 [190] 3.382287 3.382287 17.251020 3.382287 6.560821 3.382287 17.251020 [197] 17.251020 0.000000 12.605469 0.000000 12.605469 3.382287 6.560821 [204] 12.605469 12.605469 3.382287 3.382287 12.605469 17.251020 12.605469 [211] 3.382287 3.382287 17.251020 0.000000 6.560821 3.382287 3.382287 [218] 0.000000 6.560821 0.000000 6.560821 6.560821 3.382287 0.000000 [225] 3.382287 3.382287 17.251020 3.382287 0.000000 17.251020 3.382287 [232] 6.560821 17.251020 0.000000 0.000000 3.382287 3.382287 12.605469 [239] 6.560821 12.605469 3.382287 12.605469 17.251020 6.560821 17.251020 [246] 17.251020 15.892672 0.000000 3.382287 3.382287 3.382287 0.000000 [253] 12.605469 15.892672 6.560821 3.382287 3.382287 0.000000 0.000000 [260] 12.605469 6.560821 3.382287 3.382287 12.605469 17.251020 0.000000 [267] 6.560821 15.892672 3.382287 15.892672 3.382287 12.605469 0.000000 [274] 17.251020 15.892672 6.560821 3.382287 12.605469 0.000000 3.382287 [281] 3.382287 12.605469 3.382287 0.000000 17.251020 15.892672 17.251020 [288] 3.382287 17.251020 3.382287 3.382287 3.382287 15.892672 0.000000 [295] 0.000000 17.251020 17.251020 12.605469 0.000000 12.605469 17.251020 [302] 15.892672 15.892672 0.000000 3.382287 12.605469 12.605469 15.892672 [309] 6.560821 15.892672 12.605469 12.605469 17.251020 0.000000 17.251020 [316] 3.382287 17.251020 3.382287 12.605469 0.000000 6.560821 3.382287 [323] 0.000000 15.892672 17.251020 17.251020 17.251020 3.382287 6.560821 [330] 0.000000 0.000000 12.605469 12.605469 12.605469 0.000000 12.605469 [337] 0.000000 15.892672 6.560821 17.251020 12.605469 12.605469 6.560821 [344] 0.000000 0.000000 17.251020 0.000000 0.000000 12.605469 0.000000 [351] 3.382287 3.382287 6.560821 17.251020 9.671438 0.000000 9.671438 [358] 9.671438 12.605469 3.382287 12.605469 3.382287 17.251020 0.000000 [365] 12.605469 0.000000 3.382287 0.000000 3.382287 6.560821 0.000000 [372] 6.560821 6.560821 17.251020 15.892672 0.000000 17.251020 0.000000 [379] 3.382287 17.251020 3.382287 12.605469 3.382287 3.382287 12.605469 [386] 3.382287 3.382287 0.000000 15.892672 0.000000 12.605469 0.000000 [393] 15.892672 6.560821 15.892672 15.892672 6.560821 6.560821 3.382287 [400] 3.382287 17.251020 17.251020 6.560821 12.605469 9.671438 15.892672 [407] 17.251020 6.560821 3.382287 0.000000 6.560821 6.560821 15.892672 [414] 3.382287 0.000000 0.000000 0.000000 0.000000 3.382287 3.382287 [421] 0.000000 3.382287 3.382287 12.605469 17.251020 17.251020 17.251020 [428] 0.000000 15.892672 17.251020 17.251020 0.000000 0.000000 17.251020 [435] 12.605469 6.560821 0.000000 0.000000 3.382287 0.000000 15.892672 [442] 12.605469 17.251020 3.382287 12.605469 0.000000 17.251020 0.000000 [449] 6.560821 12.605469 6.560821 12.605469 15.892672 12.605469 12.605469 [456] 0.000000 0.000000 3.382287 0.000000 3.382287 0.000000 0.000000 [463] 0.000000 17.251020 6.560821 17.251020 12.605469 12.605469 3.382287 [470] 17.251020 0.000000 3.382287 0.000000 6.560821 0.000000 0.000000 [477] 3.382287 15.892672 3.382287 12.605469 0.000000 3.382287 12.605469 [484] 6.560821 17.251020 9.671438 15.892672 17.251020 15.892672 0.000000 [491] 0.000000 3.382287 3.382287 17.251020 0.000000 6.560821 12.605469 [498] 12.605469 12.605469 3.382287 3.382287 3.382287 15.892672 0.000000 [505] 6.560821 3.382287 17.251020 3.382287 12.605469 12.605469 15.892672 [512] 0.000000 12.605469 17.251020 6.560821 0.000000 3.382287 0.000000 [519] 15.892672 0.000000 12.605469 12.605469 0.000000 17.251020 0.000000 [526] 9.671438 0.000000 3.382287 15.892672 3.382287 3.382287 3.382287 [533] 17.251020 15.892672 0.000000 0.000000 0.000000 15.892672 6.560821 [540] 17.251020 17.251020 6.560821 0.000000 0.000000 3.382287 12.605469 [547] 12.605469 0.000000 3.382287 15.892672 0.000000 0.000000 3.382287 [554] 0.000000 0.000000 0.000000 17.251020 17.251020 17.251020 12.605469 [561] 0.000000 15.892672 0.000000 3.382287 3.382287 12.605469 6.560821 [568] 12.605469 3.382287 3.382287 0.000000 17.251020 6.560821 15.892672 [575] 0.000000 9.671438 3.382287 3.382287 0.000000 12.605469 3.382287 [582] 12.605469 3.382287 0.000000 6.560821 0.000000 3.382287 17.251020 [589] 3.382287 12.605469 12.605469 17.251020 3.382287 9.671438 0.000000 [596] 17.251020 0.000000 6.560821 9.671438 9.671438 0.000000 0.000000 [603] 0.000000 12.605469 17.251020 12.605469 12.605469 6.560821 6.560821 [610] 15.892672 3.382287 6.560821 6.560821 9.671438 17.251020 17.251020 [617] 0.000000 3.382287 12.605469 15.892672 3.382287 0.000000 17.251020 [624] 12.605469 6.560821 17.251020 17.251020 0.000000 6.560821 15.892672 [631] 6.560821 6.560821 0.000000 15.892672 17.251020 0.000000 3.382287 [638] 17.251020 $se.fit [1] 0.1322852 0.2566014 0.4930147 0.4930147 0.6747076 0.0000000 0.0000000 [8] 0.2566014 0.6747076 0.1322852 0.6215810 0.1322852 0.0000000 0.3782613 [15] 0.6215810 0.6747076 0.4930147 0.6747076 0.1322852 0.6747076 0.6747076 [22] 0.3782613 0.1322852 0.4930147 0.0000000 0.4930147 0.1322852 0.2566014 [29] 0.0000000 0.6747076 0.0000000 0.3782613 0.4930147 0.1322852 0.1322852 [36] 0.0000000 0.0000000 0.4930147 0.0000000 0.4930147 0.0000000 0.6215810 [43] 0.4930147 0.6215810 0.1322852 0.6747076 0.6747076 0.2566014 0.1322852 [50] 0.0000000 0.3782613 0.6747076 0.6215810 0.0000000 0.1322852 0.6747076 [57] 0.2566014 0.6747076 0.0000000 0.1322852 0.4930147 0.4930147 0.0000000 [64] 0.0000000 0.6215810 0.6215810 0.0000000 0.4930147 0.6215810 0.1322852 [71] 0.6215810 0.2566014 0.1322852 0.6747076 0.4930147 0.0000000 0.4930147 [78] 0.4930147 0.1322852 0.0000000 0.0000000 0.0000000 0.1322852 0.1322852 [85] 0.1322852 0.2566014 0.1322852 0.0000000 0.1322852 0.6747076 0.2566014 [92] 0.1322852 0.6747076 0.3782613 0.1322852 0.0000000 0.1322852 0.1322852 [99] 0.4930147 0.0000000 0.1322852 0.1322852 0.4930147 0.0000000 0.0000000 [106] 0.6747076 0.0000000 0.2566014 0.6215810 0.6747076 0.1322852 0.6747076 [113] 0.1322852 0.0000000 0.0000000 0.1322852 0.2566014 0.0000000 0.2566014 [120] 0.1322852 0.0000000 0.0000000 0.2566014 0.6215810 0.4930147 0.4930147 [127] 0.0000000 0.6747076 0.0000000 0.6747076 0.1322852 0.0000000 0.4930147 [134] 0.6747076 0.0000000 0.1322852 0.0000000 0.2566014 0.2566014 0.2566014 [141] 0.1322852 0.6747076 0.0000000 0.0000000 0.1322852 0.0000000 0.6215810 [148] 0.6747076 0.1322852 0.6215810 0.0000000 0.6747076 0.2566014 0.1322852 [155] 0.4930147 0.2566014 0.2566014 0.1322852 0.1322852 0.0000000 0.1322852 [162] 0.0000000 0.1322852 0.4930147 0.1322852 0.0000000 0.6747076 0.0000000 [169] 0.0000000 0.1322852 0.6747076 0.1322852 0.6747076 0.6215810 0.2566014 [176] 0.4930147 0.1322852 0.0000000 0.4930147 0.0000000 0.4930147 0.6747076 [183] 0.4930147 0.0000000 0.0000000 0.4930147 0.1322852 0.4930147 0.6747076 [190] 0.1322852 0.1322852 0.6747076 0.1322852 0.2566014 0.1322852 0.6747076 [197] 0.6747076 0.0000000 0.4930147 0.0000000 0.4930147 0.1322852 0.2566014 [204] 0.4930147 0.4930147 0.1322852 0.1322852 0.4930147 0.6747076 0.4930147 [211] 0.1322852 0.1322852 0.6747076 0.0000000 0.2566014 0.1322852 0.1322852 [218] 0.0000000 0.2566014 0.0000000 0.2566014 0.2566014 0.1322852 0.0000000 [225] 0.1322852 0.1322852 0.6747076 0.1322852 0.0000000 0.6747076 0.1322852 [232] 0.2566014 0.6747076 0.0000000 0.0000000 0.1322852 0.1322852 0.4930147 [239] 0.2566014 0.4930147 0.1322852 0.4930147 0.6747076 0.2566014 0.6747076 [246] 0.6747076 0.6215810 0.0000000 0.1322852 0.1322852 0.1322852 0.0000000 [253] 0.4930147 0.6215810 0.2566014 0.1322852 0.1322852 0.0000000 0.0000000 [260] 0.4930147 0.2566014 0.1322852 0.1322852 0.4930147 0.6747076 0.0000000 [267] 0.2566014 0.6215810 0.1322852 0.6215810 0.1322852 0.4930147 0.0000000 [274] 0.6747076 0.6215810 0.2566014 0.1322852 0.4930147 0.0000000 0.1322852 [281] 0.1322852 0.4930147 0.1322852 0.0000000 0.6747076 0.6215810 0.6747076 [288] 0.1322852 0.6747076 0.1322852 0.1322852 0.1322852 0.6215810 0.0000000 [295] 0.0000000 0.6747076 0.6747076 0.4930147 0.0000000 0.4930147 0.6747076 [302] 0.6215810 0.6215810 0.0000000 0.1322852 0.4930147 0.4930147 0.6215810 [309] 0.2566014 0.6215810 0.4930147 0.4930147 0.6747076 0.0000000 0.6747076 [316] 0.1322852 0.6747076 0.1322852 0.4930147 0.0000000 0.2566014 0.1322852 [323] 0.0000000 0.6215810 0.6747076 0.6747076 0.6747076 0.1322852 0.2566014 [330] 0.0000000 0.0000000 0.4930147 0.4930147 0.4930147 0.0000000 0.4930147 [337] 0.0000000 0.6215810 0.2566014 0.6747076 0.4930147 0.4930147 0.2566014 [344] 0.0000000 0.0000000 0.6747076 0.0000000 0.0000000 0.4930147 0.0000000 [351] 0.1322852 0.1322852 0.2566014 0.6747076 0.3782613 0.0000000 0.3782613 [358] 0.3782613 0.4930147 0.1322852 0.4930147 0.1322852 0.6747076 0.0000000 [365] 0.4930147 0.0000000 0.1322852 0.0000000 0.1322852 0.2566014 0.0000000 [372] 0.2566014 0.2566014 0.6747076 0.6215810 0.0000000 0.6747076 0.0000000 [379] 0.1322852 0.6747076 0.1322852 0.4930147 0.1322852 0.1322852 0.4930147 [386] 0.1322852 0.1322852 0.0000000 0.6215810 0.0000000 0.4930147 0.0000000 [393] 0.6215810 0.2566014 0.6215810 0.6215810 0.2566014 0.2566014 0.1322852 [400] 0.1322852 0.6747076 0.6747076 0.2566014 0.4930147 0.3782613 0.6215810 [407] 0.6747076 0.2566014 0.1322852 0.0000000 0.2566014 0.2566014 0.6215810 [414] 0.1322852 0.0000000 0.0000000 0.0000000 0.0000000 0.1322852 0.1322852 [421] 0.0000000 0.1322852 0.1322852 0.4930147 0.6747076 0.6747076 0.6747076 [428] 0.0000000 0.6215810 0.6747076 0.6747076 0.0000000 0.0000000 0.6747076 [435] 0.4930147 0.2566014 0.0000000 0.0000000 0.1322852 0.0000000 0.6215810 [442] 0.4930147 0.6747076 0.1322852 0.4930147 0.0000000 0.6747076 0.0000000 [449] 0.2566014 0.4930147 0.2566014 0.4930147 0.6215810 0.4930147 0.4930147 [456] 0.0000000 0.0000000 0.1322852 0.0000000 0.1322852 0.0000000 0.0000000 [463] 0.0000000 0.6747076 0.2566014 0.6747076 0.4930147 0.4930147 0.1322852 [470] 0.6747076 0.0000000 0.1322852 0.0000000 0.2566014 0.0000000 0.0000000 [477] 0.1322852 0.6215810 0.1322852 0.4930147 0.0000000 0.1322852 0.4930147 [484] 0.2566014 0.6747076 0.3782613 0.6215810 0.6747076 0.6215810 0.0000000 [491] 0.0000000 0.1322852 0.1322852 0.6747076 0.0000000 0.2566014 0.4930147 [498] 0.4930147 0.4930147 0.1322852 0.1322852 0.1322852 0.6215810 0.0000000 [505] 0.2566014 0.1322852 0.6747076 0.1322852 0.4930147 0.4930147 0.6215810 [512] 0.0000000 0.4930147 0.6747076 0.2566014 0.0000000 0.1322852 0.0000000 [519] 0.6215810 0.0000000 0.4930147 0.4930147 0.0000000 0.6747076 0.0000000 [526] 0.3782613 0.0000000 0.1322852 0.6215810 0.1322852 0.1322852 0.1322852 [533] 0.6747076 0.6215810 0.0000000 0.0000000 0.0000000 0.6215810 0.2566014 [540] 0.6747076 0.6747076 0.2566014 0.0000000 0.0000000 0.1322852 0.4930147 [547] 0.4930147 0.0000000 0.1322852 0.6215810 0.0000000 0.0000000 0.1322852 [554] 0.0000000 0.0000000 0.0000000 0.6747076 0.6747076 0.6747076 0.4930147 [561] 0.0000000 0.6215810 0.0000000 0.1322852 0.1322852 0.4930147 0.2566014 [568] 0.4930147 0.1322852 0.1322852 0.0000000 0.6747076 0.2566014 0.6215810 [575] 0.0000000 0.3782613 0.1322852 0.1322852 0.0000000 0.4930147 0.1322852 [582] 0.4930147 0.1322852 0.0000000 0.2566014 0.0000000 0.1322852 0.6747076 [589] 0.1322852 0.4930147 0.4930147 0.6747076 0.1322852 0.3782613 0.0000000 [596] 0.6747076 0.0000000 0.2566014 0.3782613 0.3782613 0.0000000 0.0000000 [603] 0.0000000 0.4930147 0.6747076 0.4930147 0.4930147 0.2566014 0.2566014 [610] 0.6215810 0.1322852 0.2566014 0.2566014 0.3782613 0.6747076 0.6747076 [617] 0.0000000 0.1322852 0.4930147 0.6215810 0.1322852 0.0000000 0.6747076 [624] 0.4930147 0.2566014 0.6747076 0.6747076 0.0000000 0.2566014 0.6215810 [631] 0.2566014 0.2566014 0.0000000 0.6215810 0.6747076 0.0000000 0.1322852 [638] 0.6747076 > > TD(fit0, Delta = 1) [1] 73.61884 > > # with covariates > fit0 <- fitMod(x,y, datset, model = "linear", addCovars = ~age+center) > fitlm <- lm(y~x+age+center, data=datset) > AIC(fit0) [1] 4193.584 > AIC(fitlm) [1] 4193.584 > summary(fit0) Dose Response Model Model: linear Fit-type: normal Residuals: Min 1Q Median 3Q Max -19.855 -3.996 -0.064 3.775 24.956 Coefficients with approx. stand. error: Estimate Std. Error e0 -11.1996 0.811196 delta 0.0136 0.000532 age -0.0126 0.009027 centergreen 0.0191 0.793736 centerred 1.1979 0.810341 centersilver 0.7446 0.817870 centeryellow 1.2027 0.826882 Residual standard error: 6.43 Degrees of freedom: 631 > summary(fitlm) Call: lm(formula = y ~ x + age + center, data = datset) Residuals: Min 1Q Median 3Q Max -24.956 -3.775 0.064 3.996 19.855 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.120e+01 8.112e-01 -13.806 <2e-16 *** x 1.360e-02 5.316e-04 25.575 <2e-16 *** age -1.255e-02 9.027e-03 -1.391 0.165 centergreen 1.906e-02 7.937e-01 0.024 0.981 centerred 1.198e+00 8.103e-01 1.478 0.140 centersilver 7.446e-01 8.179e-01 0.910 0.363 centeryellow 1.203e+00 8.269e-01 1.455 0.146 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.427 on 631 degrees of freedom Multiple R-squared: 0.5116, Adjusted R-squared: 0.507 F-statistic: 110.2 on 6 and 631 DF, p-value: < 2.2e-16 > > vcov(fit0 ) e0 delta age centergreen e0 0.6580393306 -1.631958e-04 -4.307448e-03 -3.626158e-01 delta -0.0001631958 2.826129e-07 -4.180339e-09 -8.076204e-07 age -0.0043074482 -4.180339e-09 8.148624e-05 5.148937e-04 centergreen -0.3626157873 -8.076204e-07 5.148937e-04 6.300174e-01 centerred -0.3460806667 -1.885394e-06 2.140485e-04 3.372074e-01 centersilver -0.3642369060 1.847581e-05 3.347250e-04 3.379136e-01 centeryellow -0.3253014822 3.596102e-06 -2.387489e-04 3.343312e-01 centerred centersilver centeryellow e0 -3.460807e-01 -3.642369e-01 -3.253015e-01 delta -1.885394e-06 1.847581e-05 3.596102e-06 age 2.140485e-04 3.347250e-04 -2.387489e-04 centergreen 3.372074e-01 3.379136e-01 3.343312e-01 centerred 6.566532e-01 3.366063e-01 3.351988e-01 centersilver 3.366063e-01 6.689109e-01 3.351035e-01 centeryellow 3.351988e-01 3.351035e-01 6.837334e-01 > vcov(fitlm) (Intercept) x age centergreen (Intercept) 0.6580393306 -1.631958e-04 -4.307448e-03 -3.626158e-01 x -0.0001631958 2.826129e-07 -4.180339e-09 -8.076204e-07 age -0.0043074482 -4.180339e-09 8.148624e-05 5.148937e-04 centergreen -0.3626157873 -8.076204e-07 5.148937e-04 6.300174e-01 centerred -0.3460806667 -1.885394e-06 2.140485e-04 3.372074e-01 centersilver -0.3642369060 1.847581e-05 3.347250e-04 3.379136e-01 centeryellow -0.3253014822 3.596102e-06 -2.387489e-04 3.343312e-01 centerred centersilver centeryellow (Intercept) -3.460807e-01 -3.642369e-01 -3.253015e-01 x -1.885394e-06 1.847581e-05 3.596102e-06 age 2.140485e-04 3.347250e-04 -2.387489e-04 centergreen 3.372074e-01 3.379136e-01 3.343312e-01 centerred 6.566532e-01 3.366063e-01 3.351988e-01 centersilver 3.366063e-01 6.689109e-01 3.351035e-01 centeryellow 3.351988e-01 3.351035e-01 6.837334e-01 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 3.385405 6.566871 12.617093 12.617093 17.266927 0.000000 0.000000 [8] 6.566871 17.266927 3.385405 15.907326 3.385405 0.000000 9.680356 [15] 15.907326 17.266927 12.617093 17.266927 3.385405 17.266927 17.266927 [22] 9.680356 3.385405 12.617093 0.000000 12.617093 3.385405 6.566871 [29] 0.000000 17.266927 0.000000 9.680356 12.617093 3.385405 3.385405 [36] 0.000000 0.000000 12.617093 0.000000 12.617093 0.000000 15.907326 [43] 12.617093 15.907326 3.385405 17.266927 17.266927 6.566871 3.385405 [50] 0.000000 9.680356 17.266927 15.907326 0.000000 3.385405 17.266927 [57] 6.566871 17.266927 0.000000 3.385405 12.617093 12.617093 0.000000 [64] 0.000000 15.907326 15.907326 0.000000 12.617093 15.907326 3.385405 [71] 15.907326 6.566871 3.385405 17.266927 12.617093 0.000000 12.617093 [78] 12.617093 3.385405 0.000000 0.000000 0.000000 3.385405 3.385405 [85] 3.385405 6.566871 3.385405 0.000000 3.385405 17.266927 6.566871 [92] 3.385405 17.266927 9.680356 3.385405 0.000000 3.385405 3.385405 [99] 12.617093 0.000000 3.385405 3.385405 12.617093 0.000000 0.000000 [106] 17.266927 0.000000 6.566871 15.907326 17.266927 3.385405 17.266927 [113] 3.385405 0.000000 0.000000 3.385405 6.566871 0.000000 6.566871 [120] 3.385405 0.000000 0.000000 6.566871 15.907326 12.617093 12.617093 [127] 0.000000 17.266927 0.000000 17.266927 3.385405 0.000000 12.617093 [134] 17.266927 0.000000 3.385405 0.000000 6.566871 6.566871 6.566871 [141] 3.385405 17.266927 0.000000 0.000000 3.385405 0.000000 15.907326 [148] 17.266927 3.385405 15.907326 0.000000 17.266927 6.566871 3.385405 [155] 12.617093 6.566871 6.566871 3.385405 3.385405 0.000000 3.385405 [162] 0.000000 3.385405 12.617093 3.385405 0.000000 17.266927 0.000000 [169] 0.000000 3.385405 17.266927 3.385405 17.266927 15.907326 6.566871 [176] 12.617093 3.385405 0.000000 12.617093 0.000000 12.617093 17.266927 [183] 12.617093 0.000000 0.000000 12.617093 3.385405 12.617093 17.266927 [190] 3.385405 3.385405 17.266927 3.385405 6.566871 3.385405 17.266927 [197] 17.266927 0.000000 12.617093 0.000000 12.617093 3.385405 6.566871 [204] 12.617093 12.617093 3.385405 3.385405 12.617093 17.266927 12.617093 [211] 3.385405 3.385405 17.266927 0.000000 6.566871 3.385405 3.385405 [218] 0.000000 6.566871 0.000000 6.566871 6.566871 3.385405 0.000000 [225] 3.385405 3.385405 17.266927 3.385405 0.000000 17.266927 3.385405 [232] 6.566871 17.266927 0.000000 0.000000 3.385405 3.385405 12.617093 [239] 6.566871 12.617093 3.385405 12.617093 17.266927 6.566871 17.266927 [246] 17.266927 15.907326 0.000000 3.385405 3.385405 3.385405 0.000000 [253] 12.617093 15.907326 6.566871 3.385405 3.385405 0.000000 0.000000 [260] 12.617093 6.566871 3.385405 3.385405 12.617093 17.266927 0.000000 [267] 6.566871 15.907326 3.385405 15.907326 3.385405 12.617093 0.000000 [274] 17.266927 15.907326 6.566871 3.385405 12.617093 0.000000 3.385405 [281] 3.385405 12.617093 3.385405 0.000000 17.266927 15.907326 17.266927 [288] 3.385405 17.266927 3.385405 3.385405 3.385405 15.907326 0.000000 [295] 0.000000 17.266927 17.266927 12.617093 0.000000 12.617093 17.266927 [302] 15.907326 15.907326 0.000000 3.385405 12.617093 12.617093 15.907326 [309] 6.566871 15.907326 12.617093 12.617093 17.266927 0.000000 17.266927 [316] 3.385405 17.266927 3.385405 12.617093 0.000000 6.566871 3.385405 [323] 0.000000 15.907326 17.266927 17.266927 17.266927 3.385405 6.566871 [330] 0.000000 0.000000 12.617093 12.617093 12.617093 0.000000 12.617093 [337] 0.000000 15.907326 6.566871 17.266927 12.617093 12.617093 6.566871 [344] 0.000000 0.000000 17.266927 0.000000 0.000000 12.617093 0.000000 [351] 3.385405 3.385405 6.566871 17.266927 9.680356 0.000000 9.680356 [358] 9.680356 12.617093 3.385405 12.617093 3.385405 17.266927 0.000000 [365] 12.617093 0.000000 3.385405 0.000000 3.385405 6.566871 0.000000 [372] 6.566871 6.566871 17.266927 15.907326 0.000000 17.266927 0.000000 [379] 3.385405 17.266927 3.385405 12.617093 3.385405 3.385405 12.617093 [386] 3.385405 3.385405 0.000000 15.907326 0.000000 12.617093 0.000000 [393] 15.907326 6.566871 15.907326 15.907326 6.566871 6.566871 3.385405 [400] 3.385405 17.266927 17.266927 6.566871 12.617093 9.680356 15.907326 [407] 17.266927 6.566871 3.385405 0.000000 6.566871 6.566871 15.907326 [414] 3.385405 0.000000 0.000000 0.000000 0.000000 3.385405 3.385405 [421] 0.000000 3.385405 3.385405 12.617093 17.266927 17.266927 17.266927 [428] 0.000000 15.907326 17.266927 17.266927 0.000000 0.000000 17.266927 [435] 12.617093 6.566871 0.000000 0.000000 3.385405 0.000000 15.907326 [442] 12.617093 17.266927 3.385405 12.617093 0.000000 17.266927 0.000000 [449] 6.566871 12.617093 6.566871 12.617093 15.907326 12.617093 12.617093 [456] 0.000000 0.000000 3.385405 0.000000 3.385405 0.000000 0.000000 [463] 0.000000 17.266927 6.566871 17.266927 12.617093 12.617093 3.385405 [470] 17.266927 0.000000 3.385405 0.000000 6.566871 0.000000 0.000000 [477] 3.385405 15.907326 3.385405 12.617093 0.000000 3.385405 12.617093 [484] 6.566871 17.266927 9.680356 15.907326 17.266927 15.907326 0.000000 [491] 0.000000 3.385405 3.385405 17.266927 0.000000 6.566871 12.617093 [498] 12.617093 12.617093 3.385405 3.385405 3.385405 15.907326 0.000000 [505] 6.566871 3.385405 17.266927 3.385405 12.617093 12.617093 15.907326 [512] 0.000000 12.617093 17.266927 6.566871 0.000000 3.385405 0.000000 [519] 15.907326 0.000000 12.617093 12.617093 0.000000 17.266927 0.000000 [526] 9.680356 0.000000 3.385405 15.907326 3.385405 3.385405 3.385405 [533] 17.266927 15.907326 0.000000 0.000000 0.000000 15.907326 6.566871 [540] 17.266927 17.266927 6.566871 0.000000 0.000000 3.385405 12.617093 [547] 12.617093 0.000000 3.385405 15.907326 0.000000 0.000000 3.385405 [554] 0.000000 0.000000 0.000000 17.266927 17.266927 17.266927 12.617093 [561] 0.000000 15.907326 0.000000 3.385405 3.385405 12.617093 6.566871 [568] 12.617093 3.385405 3.385405 0.000000 17.266927 6.566871 15.907326 [575] 0.000000 9.680356 3.385405 3.385405 0.000000 12.617093 3.385405 [582] 12.617093 3.385405 0.000000 6.566871 0.000000 3.385405 17.266927 [589] 3.385405 12.617093 12.617093 17.266927 3.385405 9.680356 0.000000 [596] 17.266927 0.000000 6.566871 9.680356 9.680356 0.000000 0.000000 [603] 0.000000 12.617093 17.266927 12.617093 12.617093 6.566871 6.566871 [610] 15.907326 3.385405 6.566871 6.566871 9.680356 17.266927 17.266927 [617] 0.000000 3.385405 12.617093 15.907326 3.385405 0.000000 17.266927 [624] 12.617093 6.566871 17.266927 17.266927 0.000000 6.566871 15.907326 [631] 6.566871 6.566871 0.000000 15.907326 17.266927 0.000000 3.385405 [638] 17.266927 $se.fit [1] 0.1323718 0.2567693 0.4933373 0.4933373 0.6751491 0.0000000 0.0000000 [8] 0.2567693 0.6751491 0.1323718 0.6219878 0.1323718 0.0000000 0.3785088 [15] 0.6219878 0.6751491 0.4933373 0.6751491 0.1323718 0.6751491 0.6751491 [22] 0.3785088 0.1323718 0.4933373 0.0000000 0.4933373 0.1323718 0.2567693 [29] 0.0000000 0.6751491 0.0000000 0.3785088 0.4933373 0.1323718 0.1323718 [36] 0.0000000 0.0000000 0.4933373 0.0000000 0.4933373 0.0000000 0.6219878 [43] 0.4933373 0.6219878 0.1323718 0.6751491 0.6751491 0.2567693 0.1323718 [50] 0.0000000 0.3785088 0.6751491 0.6219878 0.0000000 0.1323718 0.6751491 [57] 0.2567693 0.6751491 0.0000000 0.1323718 0.4933373 0.4933373 0.0000000 [64] 0.0000000 0.6219878 0.6219878 0.0000000 0.4933373 0.6219878 0.1323718 [71] 0.6219878 0.2567693 0.1323718 0.6751491 0.4933373 0.0000000 0.4933373 [78] 0.4933373 0.1323718 0.0000000 0.0000000 0.0000000 0.1323718 0.1323718 [85] 0.1323718 0.2567693 0.1323718 0.0000000 0.1323718 0.6751491 0.2567693 [92] 0.1323718 0.6751491 0.3785088 0.1323718 0.0000000 0.1323718 0.1323718 [99] 0.4933373 0.0000000 0.1323718 0.1323718 0.4933373 0.0000000 0.0000000 [106] 0.6751491 0.0000000 0.2567693 0.6219878 0.6751491 0.1323718 0.6751491 [113] 0.1323718 0.0000000 0.0000000 0.1323718 0.2567693 0.0000000 0.2567693 [120] 0.1323718 0.0000000 0.0000000 0.2567693 0.6219878 0.4933373 0.4933373 [127] 0.0000000 0.6751491 0.0000000 0.6751491 0.1323718 0.0000000 0.4933373 [134] 0.6751491 0.0000000 0.1323718 0.0000000 0.2567693 0.2567693 0.2567693 [141] 0.1323718 0.6751491 0.0000000 0.0000000 0.1323718 0.0000000 0.6219878 [148] 0.6751491 0.1323718 0.6219878 0.0000000 0.6751491 0.2567693 0.1323718 [155] 0.4933373 0.2567693 0.2567693 0.1323718 0.1323718 0.0000000 0.1323718 [162] 0.0000000 0.1323718 0.4933373 0.1323718 0.0000000 0.6751491 0.0000000 [169] 0.0000000 0.1323718 0.6751491 0.1323718 0.6751491 0.6219878 0.2567693 [176] 0.4933373 0.1323718 0.0000000 0.4933373 0.0000000 0.4933373 0.6751491 [183] 0.4933373 0.0000000 0.0000000 0.4933373 0.1323718 0.4933373 0.6751491 [190] 0.1323718 0.1323718 0.6751491 0.1323718 0.2567693 0.1323718 0.6751491 [197] 0.6751491 0.0000000 0.4933373 0.0000000 0.4933373 0.1323718 0.2567693 [204] 0.4933373 0.4933373 0.1323718 0.1323718 0.4933373 0.6751491 0.4933373 [211] 0.1323718 0.1323718 0.6751491 0.0000000 0.2567693 0.1323718 0.1323718 [218] 0.0000000 0.2567693 0.0000000 0.2567693 0.2567693 0.1323718 0.0000000 [225] 0.1323718 0.1323718 0.6751491 0.1323718 0.0000000 0.6751491 0.1323718 [232] 0.2567693 0.6751491 0.0000000 0.0000000 0.1323718 0.1323718 0.4933373 [239] 0.2567693 0.4933373 0.1323718 0.4933373 0.6751491 0.2567693 0.6751491 [246] 0.6751491 0.6219878 0.0000000 0.1323718 0.1323718 0.1323718 0.0000000 [253] 0.4933373 0.6219878 0.2567693 0.1323718 0.1323718 0.0000000 0.0000000 [260] 0.4933373 0.2567693 0.1323718 0.1323718 0.4933373 0.6751491 0.0000000 [267] 0.2567693 0.6219878 0.1323718 0.6219878 0.1323718 0.4933373 0.0000000 [274] 0.6751491 0.6219878 0.2567693 0.1323718 0.4933373 0.0000000 0.1323718 [281] 0.1323718 0.4933373 0.1323718 0.0000000 0.6751491 0.6219878 0.6751491 [288] 0.1323718 0.6751491 0.1323718 0.1323718 0.1323718 0.6219878 0.0000000 [295] 0.0000000 0.6751491 0.6751491 0.4933373 0.0000000 0.4933373 0.6751491 [302] 0.6219878 0.6219878 0.0000000 0.1323718 0.4933373 0.4933373 0.6219878 [309] 0.2567693 0.6219878 0.4933373 0.4933373 0.6751491 0.0000000 0.6751491 [316] 0.1323718 0.6751491 0.1323718 0.4933373 0.0000000 0.2567693 0.1323718 [323] 0.0000000 0.6219878 0.6751491 0.6751491 0.6751491 0.1323718 0.2567693 [330] 0.0000000 0.0000000 0.4933373 0.4933373 0.4933373 0.0000000 0.4933373 [337] 0.0000000 0.6219878 0.2567693 0.6751491 0.4933373 0.4933373 0.2567693 [344] 0.0000000 0.0000000 0.6751491 0.0000000 0.0000000 0.4933373 0.0000000 [351] 0.1323718 0.1323718 0.2567693 0.6751491 0.3785088 0.0000000 0.3785088 [358] 0.3785088 0.4933373 0.1323718 0.4933373 0.1323718 0.6751491 0.0000000 [365] 0.4933373 0.0000000 0.1323718 0.0000000 0.1323718 0.2567693 0.0000000 [372] 0.2567693 0.2567693 0.6751491 0.6219878 0.0000000 0.6751491 0.0000000 [379] 0.1323718 0.6751491 0.1323718 0.4933373 0.1323718 0.1323718 0.4933373 [386] 0.1323718 0.1323718 0.0000000 0.6219878 0.0000000 0.4933373 0.0000000 [393] 0.6219878 0.2567693 0.6219878 0.6219878 0.2567693 0.2567693 0.1323718 [400] 0.1323718 0.6751491 0.6751491 0.2567693 0.4933373 0.3785088 0.6219878 [407] 0.6751491 0.2567693 0.1323718 0.0000000 0.2567693 0.2567693 0.6219878 [414] 0.1323718 0.0000000 0.0000000 0.0000000 0.0000000 0.1323718 0.1323718 [421] 0.0000000 0.1323718 0.1323718 0.4933373 0.6751491 0.6751491 0.6751491 [428] 0.0000000 0.6219878 0.6751491 0.6751491 0.0000000 0.0000000 0.6751491 [435] 0.4933373 0.2567693 0.0000000 0.0000000 0.1323718 0.0000000 0.6219878 [442] 0.4933373 0.6751491 0.1323718 0.4933373 0.0000000 0.6751491 0.0000000 [449] 0.2567693 0.4933373 0.2567693 0.4933373 0.6219878 0.4933373 0.4933373 [456] 0.0000000 0.0000000 0.1323718 0.0000000 0.1323718 0.0000000 0.0000000 [463] 0.0000000 0.6751491 0.2567693 0.6751491 0.4933373 0.4933373 0.1323718 [470] 0.6751491 0.0000000 0.1323718 0.0000000 0.2567693 0.0000000 0.0000000 [477] 0.1323718 0.6219878 0.1323718 0.4933373 0.0000000 0.1323718 0.4933373 [484] 0.2567693 0.6751491 0.3785088 0.6219878 0.6751491 0.6219878 0.0000000 [491] 0.0000000 0.1323718 0.1323718 0.6751491 0.0000000 0.2567693 0.4933373 [498] 0.4933373 0.4933373 0.1323718 0.1323718 0.1323718 0.6219878 0.0000000 [505] 0.2567693 0.1323718 0.6751491 0.1323718 0.4933373 0.4933373 0.6219878 [512] 0.0000000 0.4933373 0.6751491 0.2567693 0.0000000 0.1323718 0.0000000 [519] 0.6219878 0.0000000 0.4933373 0.4933373 0.0000000 0.6751491 0.0000000 [526] 0.3785088 0.0000000 0.1323718 0.6219878 0.1323718 0.1323718 0.1323718 [533] 0.6751491 0.6219878 0.0000000 0.0000000 0.0000000 0.6219878 0.2567693 [540] 0.6751491 0.6751491 0.2567693 0.0000000 0.0000000 0.1323718 0.4933373 [547] 0.4933373 0.0000000 0.1323718 0.6219878 0.0000000 0.0000000 0.1323718 [554] 0.0000000 0.0000000 0.0000000 0.6751491 0.6751491 0.6751491 0.4933373 [561] 0.0000000 0.6219878 0.0000000 0.1323718 0.1323718 0.4933373 0.2567693 [568] 0.4933373 0.1323718 0.1323718 0.0000000 0.6751491 0.2567693 0.6219878 [575] 0.0000000 0.3785088 0.1323718 0.1323718 0.0000000 0.4933373 0.1323718 [582] 0.4933373 0.1323718 0.0000000 0.2567693 0.0000000 0.1323718 0.6751491 [589] 0.1323718 0.4933373 0.4933373 0.6751491 0.1323718 0.3785088 0.0000000 [596] 0.6751491 0.0000000 0.2567693 0.3785088 0.3785088 0.0000000 0.0000000 [603] 0.0000000 0.4933373 0.6751491 0.4933373 0.4933373 0.2567693 0.2567693 [610] 0.6219878 0.1323718 0.2567693 0.2567693 0.3785088 0.6751491 0.6751491 [617] 0.0000000 0.1323718 0.4933373 0.6219878 0.1323718 0.0000000 0.6751491 [624] 0.4933373 0.2567693 0.6751491 0.6751491 0.0000000 0.2567693 0.6219878 [631] 0.2567693 0.2567693 0.0000000 0.6219878 0.6751491 0.0000000 0.1323718 [638] 0.6751491 > predict(fit0, predType = "f", se.fit = T, + newdata = data.frame(x=c(0,1,2,100), age = 30, center = as.factor("blue"))) $fit [1] -11.57621 -11.56261 -11.54901 -10.21661 $se.fit [1] 0.6876991 0.6874618 0.6872248 0.6656515 > predict(fitlm, se.fit = T, + newdata = data.frame(x=c(0,1,2,100), age = 30, center = as.factor("blue"))) $fit 1 2 3 4 -11.57621 -11.56261 -11.54901 -10.21661 $se.fit 1 2 3 4 0.6876991 0.6874618 0.6872248 0.6656515 $df [1] 631 $residual.scale [1] 6.427248 > > TD(fit0, Delta = 1) [1] 73.55102 > > ######################################################################## > #### linlog model > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > off <- 0.05*max(datset$x) > > # without covariates > fit0 <- fitMod(x,y, datset, model = "linlog", addCovars = ~1,addArgs=list(off=off)) > fitlm <- lm(y~log(x+off), data=datset) > AIC(fit0) [1] 2768.739 > AIC(fitlm) [1] 2768.739 > summary(fit0) Dose Response Model Model: linlog Fit-type: normal Residuals: Min 1Q Median 3Q Max -18.804 -3.875 -0.163 4.453 17.258 Coefficients with approx. stand. error: Estimate Std. Error e0 -13.65 2.626 delta 2.21 0.402 Residual standard error: 6.12 Degrees of freedom: 426 > summary(fitlm) Call: lm(formula = y ~ log(x + off), data = datset) Residuals: Min 1Q Median 3Q Max -17.2582 -4.4526 0.1627 3.8749 18.8035 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -13.6486 2.6260 -5.197 3.14e-07 *** log(x + off) 2.2117 0.4016 5.508 6.29e-08 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.116 on 426 degrees of freedom Multiple R-squared: 0.06648, Adjusted R-squared: 0.06429 F-statistic: 30.34 on 1 and 426 DF, p-value: 6.29e-08 > > vcov(fit0 ) e0 delta e0 6.896082 -1.0477868 delta -1.047787 0.1612436 > vcov(fitlm) (Intercept) log(x + off) (Intercept) 6.896082 -1.0477868 log(x + off) -1.047787 0.1612436 > > predict(fit0, predType="effect-curve", se.fit=T) ## bug ## $fit [1] 6.008369 5.658359 0.000000 4.514640 4.877164 4.115493 6.008369 6.641510 [9] 0.000000 4.115493 5.658359 6.247655 4.514640 6.247655 4.514640 4.514640 [17] 4.115493 0.000000 6.008369 4.877164 4.877164 6.247655 6.733679 6.247655 [25] 4.115493 4.877164 0.000000 6.733679 6.641510 4.514640 4.514640 5.658359 [33] 6.008369 4.877164 4.877164 0.000000 6.008369 6.733679 4.877164 6.008369 [41] 6.733679 4.877164 6.008369 6.008369 4.877164 5.658359 4.514640 4.877164 [49] 0.000000 4.514640 5.658359 0.000000 4.877164 6.733679 4.877164 4.514640 [57] 4.877164 5.658359 6.641510 4.877164 6.733679 5.658359 0.000000 6.247655 [65] 6.247655 5.658359 4.877164 4.877164 4.115493 4.877164 6.733679 6.247655 [73] 5.658359 5.658359 4.877164 5.535104 6.008369 5.535104 6.247655 6.008369 [81] 6.247655 6.008369 5.535104 4.115493 5.658359 4.877164 6.008369 4.877164 [89] 6.247655 0.000000 6.008369 4.514640 4.514640 6.008369 4.877164 5.658359 [97] 4.877164 6.008369 6.733679 5.658359 4.115493 6.247655 0.000000 6.008369 [105] 6.247655 4.877164 6.733679 5.658359 4.115493 5.658359 5.658359 5.658359 [113] 6.008369 6.008369 6.733679 4.115493 4.877164 4.115493 4.877164 5.658359 [121] 4.514640 6.247655 4.877164 6.641510 4.115493 4.877164 5.658359 4.877164 [129] 4.514640 0.000000 6.008369 4.514640 6.733679 4.877164 4.514640 4.877164 [137] 5.658359 5.658359 4.115493 6.247655 6.641510 4.877164 5.658359 4.514640 [145] 4.115493 4.115493 6.733679 4.877164 0.000000 4.877164 5.658359 4.514640 [153] 6.641510 4.514640 4.877164 4.115493 6.247655 4.115493 6.008369 4.877164 [161] 4.514640 4.115493 4.877164 6.733679 6.247655 4.514640 4.877164 5.658359 [169] 4.115493 0.000000 5.658359 5.658359 4.877164 4.514640 4.115493 4.877164 [177] 0.000000 5.658359 6.247655 6.733679 0.000000 6.008369 4.514640 4.877164 [185] 0.000000 6.733679 5.658359 6.247655 4.514640 5.535104 5.658359 4.877164 [193] 5.658359 6.733679 6.641510 4.514640 6.008369 4.115493 4.877164 4.877164 [201] 4.115493 6.247655 5.658359 6.247655 5.535104 0.000000 4.115493 6.641510 [209] 6.247655 6.008369 4.115493 4.514640 4.514640 6.641510 6.733679 6.733679 [217] 5.658359 5.658359 6.008369 4.115493 5.658359 6.641510 6.641510 4.877164 [225] 0.000000 4.877164 0.000000 4.115493 4.877164 5.535104 4.115493 5.658359 [233] 6.733679 4.514640 6.733679 4.514640 4.514640 5.658359 6.008369 5.658359 [241] 4.877164 4.514640 4.115493 4.115493 4.115493 6.247655 5.658359 0.000000 [249] 4.115493 4.514640 6.247655 6.733679 6.008369 4.877164 4.115493 4.514640 [257] 0.000000 0.000000 5.658359 5.658359 4.514640 5.658359 4.514640 4.115493 [265] 4.877164 4.877164 4.514640 5.658359 6.008369 4.514640 4.115493 0.000000 [273] 4.877164 4.877164 4.115493 6.008369 4.514640 6.008369 4.514640 4.877164 [281] 6.008369 0.000000 0.000000 5.658359 6.247655 6.008369 6.008369 6.247655 [289] 4.877164 4.877164 4.514640 6.008369 6.008369 4.115493 6.641510 6.733679 [297] 4.514640 4.877164 4.877164 4.877164 6.008369 6.641510 4.877164 5.658359 [305] 4.514640 5.535104 4.877164 6.008369 6.008369 5.658359 4.514640 6.008369 [313] 6.247655 5.658359 6.733679 6.008369 6.247655 5.658359 5.535104 4.877164 [321] 5.658359 4.877164 4.877164 5.658359 5.658359 4.877164 4.115493 4.877164 [329] 5.658359 4.877164 4.877164 4.877164 5.658359 6.733679 6.008369 6.247655 [337] 4.877164 5.535104 6.008369 4.115493 6.008369 6.247655 4.115493 6.008369 [345] 5.658359 4.877164 6.247655 6.641510 5.658359 4.115493 6.733679 6.008369 [353] 5.658359 4.115493 4.514640 4.877164 6.733679 5.658359 0.000000 6.641510 [361] 6.733679 4.115493 6.247655 4.877164 4.877164 5.658359 4.514640 4.115493 [369] 4.877164 4.877164 4.877164 5.658359 4.877164 0.000000 5.658359 4.877164 [377] 4.877164 4.514640 4.514640 6.733679 6.008369 6.733679 4.514640 4.514640 [385] 4.115493 5.535104 4.877164 4.877164 6.247655 5.658359 6.733679 4.514640 [393] 4.877164 5.658359 6.733679 6.733679 4.514640 6.008369 5.658359 6.733679 [401] 6.733679 6.733679 0.000000 6.641510 6.733679 4.115493 4.877164 6.247655 [409] 0.000000 4.115493 4.514640 4.877164 4.877164 4.514640 6.733679 6.247655 [417] 5.658359 4.877164 4.877164 0.000000 4.877164 4.877164 0.000000 6.008369 [425] 4.115493 4.514640 4.877164 0.000000 $se.fit [1] 1.0908488 1.0273028 0.0000000 0.8196550 0.8854731 0.7471878 1.0908488 [8] 1.2057987 0.0000000 0.7471878 1.0273028 1.1342924 0.8196550 1.1342924 [15] 0.8196550 0.8196550 0.7471878 0.0000000 1.0908488 0.8854731 0.8854731 [22] 1.1342924 1.2225325 1.1342924 0.7471878 0.8854731 0.0000000 1.2225325 [29] 1.2057987 0.8196550 0.8196550 1.0273028 1.0908488 0.8854731 0.8854731 [36] 0.0000000 1.0908488 1.2225325 0.8854731 1.0908488 1.2225325 0.8854731 [43] 1.0908488 1.0908488 0.8854731 1.0273028 0.8196550 0.8854731 0.0000000 [50] 0.8196550 1.0273028 0.0000000 0.8854731 1.2225325 0.8854731 0.8196550 [57] 0.8854731 1.0273028 1.2057987 0.8854731 1.2225325 1.0273028 0.0000000 [64] 1.1342924 1.1342924 1.0273028 0.8854731 0.8854731 0.7471878 0.8854731 [71] 1.2225325 1.1342924 1.0273028 1.0273028 0.8854731 1.0049252 1.0908488 [78] 1.0049252 1.1342924 1.0908488 1.1342924 1.0908488 1.0049252 0.7471878 [85] 1.0273028 0.8854731 1.0908488 0.8854731 1.1342924 0.0000000 1.0908488 [92] 0.8196550 0.8196550 1.0908488 0.8854731 1.0273028 0.8854731 1.0908488 [99] 1.2225325 1.0273028 0.7471878 1.1342924 0.0000000 1.0908488 1.1342924 [106] 0.8854731 1.2225325 1.0273028 0.7471878 1.0273028 1.0273028 1.0273028 [113] 1.0908488 1.0908488 1.2225325 0.7471878 0.8854731 0.7471878 0.8854731 [120] 1.0273028 0.8196550 1.1342924 0.8854731 1.2057987 0.7471878 0.8854731 [127] 1.0273028 0.8854731 0.8196550 0.0000000 1.0908488 0.8196550 1.2225325 [134] 0.8854731 0.8196550 0.8854731 1.0273028 1.0273028 0.7471878 1.1342924 [141] 1.2057987 0.8854731 1.0273028 0.8196550 0.7471878 0.7471878 1.2225325 [148] 0.8854731 0.0000000 0.8854731 1.0273028 0.8196550 1.2057987 0.8196550 [155] 0.8854731 0.7471878 1.1342924 0.7471878 1.0908488 0.8854731 0.8196550 [162] 0.7471878 0.8854731 1.2225325 1.1342924 0.8196550 0.8854731 1.0273028 [169] 0.7471878 0.0000000 1.0273028 1.0273028 0.8854731 0.8196550 0.7471878 [176] 0.8854731 0.0000000 1.0273028 1.1342924 1.2225325 0.0000000 1.0908488 [183] 0.8196550 0.8854731 0.0000000 1.2225325 1.0273028 1.1342924 0.8196550 [190] 1.0049252 1.0273028 0.8854731 1.0273028 1.2225325 1.2057987 0.8196550 [197] 1.0908488 0.7471878 0.8854731 0.8854731 0.7471878 1.1342924 1.0273028 [204] 1.1342924 1.0049252 0.0000000 0.7471878 1.2057987 1.1342924 1.0908488 [211] 0.7471878 0.8196550 0.8196550 1.2057987 1.2225325 1.2225325 1.0273028 [218] 1.0273028 1.0908488 0.7471878 1.0273028 1.2057987 1.2057987 0.8854731 [225] 0.0000000 0.8854731 0.0000000 0.7471878 0.8854731 1.0049252 0.7471878 [232] 1.0273028 1.2225325 0.8196550 1.2225325 0.8196550 0.8196550 1.0273028 [239] 1.0908488 1.0273028 0.8854731 0.8196550 0.7471878 0.7471878 0.7471878 [246] 1.1342924 1.0273028 0.0000000 0.7471878 0.8196550 1.1342924 1.2225325 [253] 1.0908488 0.8854731 0.7471878 0.8196550 0.0000000 0.0000000 1.0273028 [260] 1.0273028 0.8196550 1.0273028 0.8196550 0.7471878 0.8854731 0.8854731 [267] 0.8196550 1.0273028 1.0908488 0.8196550 0.7471878 0.0000000 0.8854731 [274] 0.8854731 0.7471878 1.0908488 0.8196550 1.0908488 0.8196550 0.8854731 [281] 1.0908488 0.0000000 0.0000000 1.0273028 1.1342924 1.0908488 1.0908488 [288] 1.1342924 0.8854731 0.8854731 0.8196550 1.0908488 1.0908488 0.7471878 [295] 1.2057987 1.2225325 0.8196550 0.8854731 0.8854731 0.8854731 1.0908488 [302] 1.2057987 0.8854731 1.0273028 0.8196550 1.0049252 0.8854731 1.0908488 [309] 1.0908488 1.0273028 0.8196550 1.0908488 1.1342924 1.0273028 1.2225325 [316] 1.0908488 1.1342924 1.0273028 1.0049252 0.8854731 1.0273028 0.8854731 [323] 0.8854731 1.0273028 1.0273028 0.8854731 0.7471878 0.8854731 1.0273028 [330] 0.8854731 0.8854731 0.8854731 1.0273028 1.2225325 1.0908488 1.1342924 [337] 0.8854731 1.0049252 1.0908488 0.7471878 1.0908488 1.1342924 0.7471878 [344] 1.0908488 1.0273028 0.8854731 1.1342924 1.2057987 1.0273028 0.7471878 [351] 1.2225325 1.0908488 1.0273028 0.7471878 0.8196550 0.8854731 1.2225325 [358] 1.0273028 0.0000000 1.2057987 1.2225325 0.7471878 1.1342924 0.8854731 [365] 0.8854731 1.0273028 0.8196550 0.7471878 0.8854731 0.8854731 0.8854731 [372] 1.0273028 0.8854731 0.0000000 1.0273028 0.8854731 0.8854731 0.8196550 [379] 0.8196550 1.2225325 1.0908488 1.2225325 0.8196550 0.8196550 0.7471878 [386] 1.0049252 0.8854731 0.8854731 1.1342924 1.0273028 1.2225325 0.8196550 [393] 0.8854731 1.0273028 1.2225325 1.2225325 0.8196550 1.0908488 1.0273028 [400] 1.2225325 1.2225325 1.2225325 0.0000000 1.2057987 1.2225325 0.7471878 [407] 0.8854731 1.1342924 0.0000000 0.7471878 0.8196550 0.8854731 0.8854731 [414] 0.8196550 1.2225325 1.1342924 1.0273028 0.8854731 0.8854731 0.0000000 [421] 0.8854731 0.8854731 0.0000000 1.0908488 0.7471878 0.8196550 0.8854731 [428] 0.0000000 > > TD(fit0, Delta = 1) [1] 40.01633 > > # with covariates > fit0 <- fitMod(x,y, datset, model = "linlog", addCovars = ~age+center, + addArgs=list(off=off)) > fitlm <- lm(y~log(x+off)+age+center, data=datset) > AIC(fit0) [1] 2773.961 > AIC(fitlm) [1] 2773.961 > summary(fit0) Dose Response Model Model: linlog Fit-type: normal Residuals: Min 1Q Median 3Q Max -17.993 -3.920 -0.142 4.548 17.772 Coefficients with approx. stand. error: Estimate Std. Error e0 -12.53812 2.7627 delta 2.19176 0.4045 age -0.00815 0.0103 centergreen -0.11764 0.9231 centerred -1.68381 0.9385 centersilver -0.40779 0.9137 centeryellow -0.83235 0.9332 Residual standard error: 6.12 Degrees of freedom: 421 > summary(fitlm) Call: lm(formula = y ~ log(x + off) + age + center, data = datset) Residuals: Min 1Q Median 3Q Max -17.7720 -4.5476 0.1417 3.9205 17.9926 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -12.538125 2.762741 -4.538 7.41e-06 *** log(x + off) 2.191761 0.404501 5.418 1.01e-07 *** age -0.008153 0.010337 -0.789 0.4308 centergreen -0.117636 0.923131 -0.127 0.8987 centerred -1.683810 0.938487 -1.794 0.0735 . centersilver -0.407788 0.913735 -0.446 0.6556 centeryellow -0.832351 0.933224 -0.892 0.3730 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.118 on 421 degrees of freedom Multiple R-squared: 0.07685, Adjusted R-squared: 0.06369 F-statistic: 5.841 on 6 and 421 DF, p-value: 7.284e-06 > > vcov(fit0 ) e0 delta age centergreen e0 7.632738169 -1.0659544595 -0.0077749645 -0.2388230420 delta -1.065954459 0.1636213662 0.0003614495 -0.0285500750 age -0.007774965 0.0003614495 0.0001068627 0.0002013374 centergreen -0.238823042 -0.0285500750 0.0002013374 0.8521701509 centerred -0.327169799 -0.0143714026 0.0001539174 0.4142785346 centersilver -0.343366284 -0.0139200933 0.0004143178 0.4148464502 centeryellow -0.304904773 -0.0188552161 0.0002799329 0.4153997441 centerred centersilver centeryellow e0 -0.3271697994 -0.3433662837 -0.3049047728 delta -0.0143714026 -0.0139200933 -0.0188552161 age 0.0001539174 0.0004143178 0.0002799329 centergreen 0.4142785346 0.4148464502 0.4153997441 centerred 0.8807582409 0.4133097826 0.4135270947 centersilver 0.4133097826 0.8349108233 0.4142615949 centeryellow 0.4135270947 0.4142615949 0.8709075166 > vcov(fitlm) (Intercept) log(x + off) age centergreen (Intercept) 7.632738169 -1.0659544595 -0.0077749645 -0.2388230420 log(x + off) -1.065954459 0.1636213662 0.0003614495 -0.0285500750 age -0.007774965 0.0003614495 0.0001068627 0.0002013374 centergreen -0.238823042 -0.0285500750 0.0002013374 0.8521701509 centerred -0.327169799 -0.0143714026 0.0001539174 0.4142785346 centersilver -0.343366284 -0.0139200933 0.0004143178 0.4148464502 centeryellow -0.304904773 -0.0188552161 0.0002799329 0.4153997441 centerred centersilver centeryellow (Intercept) -0.3271697994 -0.3433662837 -0.3049047728 log(x + off) -0.0143714026 -0.0139200933 -0.0188552161 age 0.0001539174 0.0004143178 0.0002799329 centergreen 0.4142785346 0.4148464502 0.4153997441 centerred 0.8807582409 0.4133097826 0.4135270947 centersilver 0.4133097826 0.8349108233 0.4142615949 centeryellow 0.4135270947 0.4142615949 0.8709075166 > > predict(fit0, predType = "f", se.fit = T, ## degrees of freedom wrong ## + newdata = data.frame(x=c(0,1,2,100), age = 35, center = as.factor("blue"))) $fit [1] -3.511779 -3.480690 -3.450035 -1.567022 $se.fit [1] 1.1058048 1.1012159 1.0967017 0.8461873 > predict(fitlm, se.fit = T, + newdata = data.frame(x=c(0,1,2,100), age = 35, center = as.factor("blue"))) $fit 1 2 3 4 -3.511779 -3.480690 -3.450035 -1.567022 $se.fit 1 2 3 4 1.1058048 1.1012159 1.0967017 0.8461873 $df [1] 421 $residual.scale [1] 6.117927 > > TD(fit0, Delta = 1) [1] 40.47058 > > > ######################################################################## > #### quadratic model > ll <- getDosSampSiz() > datset <- getDFdataSet(ll$doses, ll$n) > > # without covariates > fit0 <- fitMod(x,y, datset, model = "quadratic", addCovars = ~1) > fitlm <- lm(y~x+I(x^2), data=datset) > AIC(fit0) [1] 54.33574 > AIC(fitlm) [1] 54.33574 > summary(fit0) Dose Response Model Model: quadratic Fit-type: normal Residuals: Min 1Q Median 3Q Max -9.08e-01 -3.06e-01 3.08e-05 2.39e-01 7.57e-01 Coefficients with approx. stand. error: Estimate Std. Error e0 -3.12e+00 9.19e-02 b1 -6.61e-04 1.47e-03 b2 5.18e-06 4.40e-06 Residual standard error: 0.401 Degrees of freedom: 46 > summary(fitlm) Call: lm(formula = y ~ x + I(x^2), data = datset) Residuals: Min 1Q Median 3Q Max -0.75741 -0.23947 -0.00003 0.30638 0.90831 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -3.118e+00 9.195e-02 -33.914 <2e-16 *** x -6.612e-04 1.466e-03 -0.451 0.654 I(x^2) 5.175e-06 4.401e-06 1.176 0.246 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4007 on 46 degrees of freedom Multiple R-squared: 0.1193, Adjusted R-squared: 0.08097 F-statistic: 3.115 on 2 and 46 DF, p-value: 0.05388 > > vcov(fit0 ) e0 b1 b2 e0 8.454726e-03 -7.868733e-05 1.608713e-07 b1 -7.868733e-05 2.149290e-06 -6.145868e-09 b2 1.608713e-07 -6.145868e-09 1.936461e-11 > vcov(fitlm) (Intercept) x I(x^2) (Intercept) 8.454726e-03 -7.868733e-05 1.608713e-07 x -7.868733e-05 2.149290e-06 -6.145868e-09 I(x^2) 1.608713e-07 -6.145868e-09 1.936461e-11 > > predict(fit0, predType="effect-curve", se.fit=T) $fit [1] 0.49280484 0.00000000 0.05861756 0.00000000 0.25773527 0.00000000 [7] 0.05861756 0.00000000 0.25773527 0.05861756 0.25773527 -0.01991690 [13] 0.05861756 -0.01991690 0.05861756 0.02376374 0.05861756 0.05861756 [19] 0.02376374 0.49280484 0.00000000 0.49280484 0.00000000 0.05861756 [25] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.02376374 [31] 0.25773527 0.00000000 0.25773527 -0.01991690 0.25773527 0.00000000 [37] 0.00000000 0.00000000 0.25773527 0.00000000 0.25773527 -0.01991690 [43] 0.25773527 0.02376374 0.05861756 -0.01991690 0.00000000 0.25773527 [49] 0.00000000 $se.fit [1] 0.19776187 0.00000000 0.13594191 0.00000000 0.13486241 0.00000000 [7] 0.13594191 0.00000000 0.13486241 0.13594191 0.13486241 0.09012454 [13] 0.13594191 0.09012454 0.13594191 0.13105561 0.13594191 0.13594191 [19] 0.13105561 0.19776187 0.00000000 0.19776187 0.00000000 0.13594191 [25] 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.13105561 [31] 0.13486241 0.00000000 0.13486241 0.09012454 0.13486241 0.00000000 [37] 0.00000000 0.00000000 0.13486241 0.00000000 0.13486241 0.09012454 [43] 0.13486241 0.13105561 0.13594191 0.09012454 0.00000000 0.13486241 [49] 0.00000000 > > predict(fit0, predType="full-model", se.fit=T, + newdata=data.frame(x=c(0, 10, 100))) $fit [1] -3.118383 -3.124477 -3.132746 $se.fit [1] 0.09194958 0.08435629 0.08409705 > predict(fitlm, se.fit=T, + newdata=data.frame(x=c(0, 10, 100))) $fit 1 2 3 -3.118383 -3.124477 -3.132746 $se.fit 1 2 3 0.09194958 0.08435629 0.08409705 $df [1] 46 $residual.scale [1] 0.4007027 > > TD(fit0, Delta = 1) [1] 508.0679 > > # with covariates > fit0 <- fitMod(x,y, datset, model = "quadratic", addCovars = ~age+center) > fitlm <- lm(y~x+I(x^2)+age+center, data=datset) > AIC(fit0) [1] 62.95473 > AIC(fitlm) [1] 62.95473 > summary(fit0) Dose Response Model Model: quadratic Fit-type: normal Residuals: Min 1Q Median 3Q Max -0.87232 -0.24673 -0.00516 0.29930 0.65583 Coefficients with approx. stand. error: Estimate Std. Error e0 -3.08e+00 1.69e-01 b1 -5.76e-04 1.59e-03 b2 4.82e-06 4.74e-06 age -1.60e-03 2.09e-03 centergreen -4.89e-03 2.03e-01 centerred 6.72e-02 1.75e-01 centersilver 7.81e-02 1.87e-01 centeryellow 9.70e-02 1.95e-01 Residual standard error: 0.418 Degrees of freedom: 41 > summary(fitlm) Call: lm(formula = y ~ x + I(x^2) + age + center, data = datset) Residuals: Min 1Q Median 3Q Max -0.65583 -0.29930 0.00516 0.24673 0.87232 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -3.076e+00 1.692e-01 -18.182 <2e-16 *** x -5.756e-04 1.594e-03 -0.361 0.720 I(x^2) 4.822e-06 4.738e-06 1.018 0.315 age -1.604e-03 2.092e-03 -0.767 0.448 centergreen -4.891e-03 2.034e-01 -0.024 0.981 centerred 6.715e-02 1.753e-01 0.383 0.704 centersilver 7.814e-02 1.875e-01 0.417 0.679 centeryellow 9.700e-02 1.950e-01 0.497 0.622 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4185 on 41 degrees of freedom Multiple R-squared: 0.1437, Adjusted R-squared: -0.002451 F-statistic: 0.9832 on 7 and 41 DF, p-value: 0.4566 > > vcov(fit0 ) e0 b1 b2 age e0 2.862812e-02 -7.239847e-05 1.267650e-07 -2.074072e-04 b1 -7.239847e-05 2.540221e-06 -7.184577e-09 5.108591e-08 b2 1.267650e-07 -7.184577e-09 2.245217e-11 3.521184e-11 age -2.074072e-04 5.108591e-08 3.521184e-11 4.376769e-06 centergreen -6.997613e-03 -8.024708e-05 1.931149e-07 -9.351576e-05 centerred -1.143502e-02 -7.161311e-06 3.686110e-08 -7.667700e-05 centersilver -1.190681e-02 -4.175985e-05 1.275528e-07 -4.035812e-05 centeryellow -1.311971e-02 -2.255991e-05 1.246186e-08 1.810824e-05 centergreen centerred centersilver centeryellow e0 -6.997613e-03 -1.143502e-02 -1.190681e-02 -1.311971e-02 b1 -8.024708e-05 -7.161311e-06 -4.175985e-05 -2.255991e-05 b2 1.931149e-07 3.686110e-08 1.275528e-07 1.246186e-08 age -9.351576e-05 -7.667700e-05 -4.035812e-05 1.810824e-05 centergreen 4.137795e-02 1.614879e-02 1.658732e-02 1.565529e-02 centerred 1.614879e-02 3.073191e-02 1.550655e-02 1.384931e-02 centersilver 1.658732e-02 1.550655e-02 3.515550e-02 1.452661e-02 centeryellow 1.565529e-02 1.384931e-02 1.452661e-02 3.804408e-02 > vcov(fitlm) (Intercept) x I(x^2) age (Intercept) 2.862812e-02 -7.239847e-05 1.267650e-07 -2.074072e-04 x -7.239847e-05 2.540221e-06 -7.184577e-09 5.108591e-08 I(x^2) 1.267650e-07 -7.184577e-09 2.245217e-11 3.521184e-11 age -2.074072e-04 5.108591e-08 3.521184e-11 4.376769e-06 centergreen -6.997613e-03 -8.024708e-05 1.931149e-07 -9.351576e-05 centerred -1.143502e-02 -7.161311e-06 3.686110e-08 -7.667700e-05 centersilver -1.190681e-02 -4.175985e-05 1.275528e-07 -4.035812e-05 centeryellow -1.311971e-02 -2.255991e-05 1.246186e-08 1.810824e-05 centergreen centerred centersilver centeryellow (Intercept) -6.997613e-03 -1.143502e-02 -1.190681e-02 -1.311971e-02 x -8.024708e-05 -7.161311e-06 -4.175985e-05 -2.255991e-05 I(x^2) 1.931149e-07 3.686110e-08 1.275528e-07 1.246186e-08 age -9.351576e-05 -7.667700e-05 -4.035812e-05 1.810824e-05 centergreen 4.137795e-02 1.614879e-02 1.658732e-02 1.565529e-02 centerred 1.614879e-02 3.073191e-02 1.550655e-02 1.384931e-02 centersilver 1.658732e-02 1.550655e-02 3.515550e-02 1.452661e-02 centeryellow 1.565529e-02 1.384931e-02 1.452661e-02 3.804408e-02 > > predict(fit0, predType = "f", se.fit = T, + newdata=data.frame(x=c(0, 10, 100), age = 30, center = as.factor("blue"))) $fit [1] -3.124527 -3.129801 -3.133870 $se.fit [1] 0.1418548 0.1377349 0.1475950 > predict(fitlm, se.fit = T, + newdata=data.frame(x=c(0, 10, 100), age = 30, center = as.factor("blue"))) $fit 1 2 3 -3.124527 -3.129801 -3.133870 $se.fit 1 2 3 0.1418548 0.1377349 0.1475950 $df [1] 41 $residual.scale [1] 0.418494 > > TD(fit0, Delta = 0.1) [1] 215.5724 > > ######################################################################## > ## ensure that predict with no argument uses the original data not the > ## sorted data that were used for fitting > > data(IBScovars) > ff <- fitMod(dose, resp, data=IBScovars, model="quadratic", + addCovars = ~gender) > ## should be all zero > predict(ff, predType = "ls-means")- + predict(ff, predType = "ls-means", doseSeq = IBScovars[,3]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > predict(ff, predType = "full-model")- + predict(ff, predType = "full-model", newdata = IBScovars[,-2]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > predict(ff, predType = "effect-curve")- + predict(ff, predType = "effect-curve", doseSeq = IBScovars[,3]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > ff2 <- fitMod(dose, resp, data=IBScovars, model="quadratic") > ## should be all zero > predict(ff2, predType = "ls-means")- + predict(ff2, predType = "ls-means", doseSeq = IBScovars[,3]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > predict(ff2, predType = "full-model")- + predict(ff2, predType = "full-model", newdata = IBScovars[,-2]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > predict(ff2, predType = "effect-curve")- + predict(ff2, predType = "effect-curve", doseSeq = IBScovars[,3]) [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [149] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [186] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [223] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [260] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [297] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [334] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > > dose <- unique(IBScovars$dose) > ord <- c(2,4,1,3,5) > mns <- tapply(IBScovars$resp, IBScovars$dose, mean)[ord] > ff3 <- fitMod(dose, mns, S=diag(5), model="quadratic", type = "general") Warning message: In checkAnalyArgs(dose, resp, data, S, type, addCovars, placAdj, : mns is not a numeric but a array, converting with as.numeric() > predict(ff3, predType = "ls-means")- + predict(ff3, predType = "ls-means", doseSeq = dose) [1] 0 0 0 0 0 > predict(ff3, predType = "effect-curve")- + predict(ff3, predType = "effect-curve", doseSeq = dose) [1] 0 0 0 0 0 > > ######################################################################## > ## ensure that S is also sorted when the dose is not entered sorted > dose <- sort(unique(IBScovars$dose)) > mns <- tapply(IBScovars$resp, IBScovars$dose, mean) > S <- c(1000,1,1,1,1)*diag(5) > ff1 <- fitMod(dose, mns, S = S, model="linear", type="general") Warning message: In checkAnalyArgs(dose, resp, data, S, type, addCovars, placAdj, : mns is not a numeric but a array, converting with as.numeric() > ## fit unsorted > dose <- unique(IBScovars$dose) > ord <- c(2,4,1,3,5) > mns <- tapply(IBScovars$resp, IBScovars$dose, mean)[ord] > ff2 <- fitMod(dose, mns, S = S, model="linear", type="general") Warning message: In checkAnalyArgs(dose, resp, data, S, type, addCovars, placAdj, : mns is not a numeric but a array, converting with as.numeric() > ff3 <- fitMod(dose, mns, S = S[ord,ord], model="linear", type="general") Warning message: In checkAnalyArgs(dose, resp, data, S, type, addCovars, placAdj, : mns is not a numeric but a array, converting with as.numeric() > ## coef(ff1) & coef(ff3) should be equal > coef(ff1) e0 delta 0.47569910 0.02447331 > coef(ff3) e0 delta 0.47569910 0.02447331 > > proc.time() user system elapsed 1.00 0.17 1.17