Running examples in 'survey-Ex.R' failed
The error most likely occurred in:

> ### Name: svymle
> ### Title: Maximum pseudolikelihood estimation in complex surveys
> ### Aliases: svymle print.svymle coef.svymle summary.svymle vcov.svymle
> ### Keywords: survey models optimize
> 
> ### ** Examples
> 
> 
>  data(api)
> 
>  dstrat<-svydesign(id=~1, strata=~stype, weight=~pw, fpc=~fpc, data=apistrat)
> 
>  ## fit with glm
>  m0 <- svyglm(api00~api99+ell,family="gaussian",design=dstrat)
>  ## fit as mle (without gradient)
>  m1 <- svymle(loglike=dnorm,gradient=NULL, design=dstrat, 
+     formulas=list(mean=api00~api99+ell, sd=~1),
+     start=list(c(80,1,0),c(20)), log=TRUE)
>  ## with gradient
>  gr<- function(x,mean,sd,log){
+ 	 dm<-2*(x - mean)/(2*sd^2)
+ 	 ds<-(x-mean)^2*(2*(2 * sd))/(2*sd^2)^2 - sqrt(2*pi)/(sd*sqrt(2*pi))
+          cbind(dm,ds)
+       }
>  m2 <- svymle(loglike=dnorm,gradient=gr, design=dstrat, 
+     formulas=list(mean=api00~api99+ell, sd=~1),
+     start=list(c(80,1,0),c(20)), log=TRUE, method="BFGS")
Warning in loglike(c(840L, 516L, 531L, 501L, 720L, 805L, 778L, 731L, 592L,  :
  NaNs produced
> 
>  summary(m0)

Call:
svyglm(formula = api00 ~ api99 + ell, design = dstrat, family = "gaussian")

Survey design:
svydesign(id = ~1, strata = ~stype, weight = ~pw, fpc = ~fpc, 
    data = apistrat)

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 79.89525   14.61154   5.468 1.38e-07 ***
api99        0.92798    0.01879  49.395  < 2e-16 ***
ell         -0.07312    0.13966  -0.524    0.601    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(Dispersion parameter for gaussian family taken to be 721.8345)

Number of Fisher Scoring iterations: 2

>  summary(m1,stderr="model")
Survey-sampled mle: 
svymle(loglike = dnorm, gradient = NULL, design = dstrat, formulas = list(mean = api00 ~ 
    api99 + ell, sd = ~1), start = list(c(80, 1, 0), c(20)), 
    log = TRUE)
                        Coef          SE p.value
mean.(Intercept) 79.86241974 14.29794856  <0.001
mean.api99        0.92800541  0.01949203  <0.001
mean.ell         -0.07270673  0.11779840   0.537
sd.(Intercept)   26.79938270  1.33994331  <0.001
Stratified Independent Sampling design
svydesign(id = ~1, strata = ~stype, weight = ~pw, fpc = ~fpc, 
    data = apistrat)
>  summary(m2)
Survey-sampled mle: 
svymle(loglike = dnorm, gradient = gr, design = dstrat, formulas = list(mean = api00 ~ 
    api99 + ell, sd = ~1), start = list(c(80, 1, 0), c(20)), 
    method = "BFGS", log = TRUE)
                        Coef          SE p.value
mean.(Intercept) 79.98826217 14.61363749  <0.001
mean.api99        0.92785231  0.01878935  <0.001
mean.ell         -0.07369146  0.13966667   0.598
sd.(Intercept)   26.79911727  1.73962068  <0.001
Stratified Independent Sampling design
svydesign(id = ~1, strata = ~stype, weight = ~pw, fpc = ~fpc, 
    data = apistrat)
> 
>  ## Using offsets
>  m3 <- svymle(loglike=dnorm,gradient=gr, design=dstrat, 
+     formulas=list(mean=api00~api99+offset(ell)+ell, sd=~1),
+     start=list(c(80,1,0),c(20)), log=TRUE, method="BFGS")
Warning in loglike(c(840L, 516L, 531L, 501L, 720L, 805L, 778L, 731L, 592L,  :
  NaNs produced
Warning in loglike(c(840L, 516L, 531L, 501L, 720L, 805L, 778L, 731L, 592L,  :
  NaNs produced
> 
> 
> ## demonstrating multiple linear predictors
> 
>  m3 <- svymle(loglike=dnorm,gradient=gr, design=dstrat, 
+     formulas=list(mean=api00~api99+offset(ell)+ell, sd=~stype),
+     start=list(c(80,1,0),c(20,0,0)), log=TRUE, method="BFGS")
Warning in loglike(c(840L, 516L, 531L, 501L, 720L, 805L, 778L, 731L, 592L,  :
  NaNs produced
Warning in loglike(c(840L, 516L, 531L, 501L, 720L, 805L, 778L, 731L, 592L,  :
  NaNs produced
> 
> 
> 
>  ## More complicated censored lognormal data example
>  ## showing that the response variable can be multivariate
> 
>  data(pbc, package="survival")
>  pbc$randomized <- with(pbc, !is.na(trt) & trt>0)
>  biasmodel<-glm(randomized~age*edema,data=pbc)
>  pbc$randprob<-fitted(biasmodel)
>  dpbc<-svydesign(id=~1, prob=~randprob, strata=~edema,
+     data=subset(pbc,randomized))
> 
> 
> ## censored logNormal likelihood
>  lcens<-function(x,mean,sd){
+     ifelse(x[,2]==1,
+            dnorm(log(x[,1]),mean,sd,log=TRUE),
+            pnorm(log(x[,1]),mean,sd,log=TRUE,lower.tail=FALSE)
+            )
+  }
> 
>  gcens<- function(x,mean,sd){
+ 
+         dz<- -dnorm(log(x[,1]),mean,sd)/pnorm(log(x[,1]),mean,sd,lower.tail=FALSE)
+ 
+         dm<-ifelse(x[,2]==1,
+                    2*(log(x[,1]) - mean)/(2*sd^2),
+                    dz*-1/sd)
+         ds<-ifelse(x[,2]==1,
+                    (log(x[,1])-mean)^2*(2*(2 * sd))/(2*sd^2)^2 - sqrt(2*pi)/(sd*sqrt(2*pi)),
+                    ds<- dz*-(log(x[,1])-mean)/(sd*sd))
+         cbind(dm,ds)      
+  }
> 
> m<-svymle(loglike=lcens, gradient=gcens, design=dpbc, method="newuoa",
+       formulas=list(mean=I(cbind(time,status>0))~bili+protime+albumin,
+                     sd=~1),
+          start=list(c(10,0,0,0),c(1)))
Error in library.dynam(lib, package, package.lib) : 
  DLL 'Rcpp' not found: maybe not installed for this architecture?
Calls: svymle ... loadNamespace -> namespaceImport -> loadNamespace -> library.dynam
Execution halted