* using log directory 'd:/Rcompile/CRANpkg/local/3.0/wfe.Rcheck' * using R version 3.0.3 (2014-03-06) * using platform: i386-w64-mingw32 (32-bit) * using session charset: ISO8859-1 * checking for file 'wfe/DESCRIPTION' ... OK * this is package 'wfe' version '1.3' * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'wfe' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * loading checks for arch 'i386' ** checking whether the package can be loaded ... OK ** checking whether the package can be loaded with stated dependencies ... OK ** checking whether the package can be unloaded cleanly ... OK ** checking whether the namespace can be loaded with stated dependencies ... OK ** checking whether the namespace can be unloaded cleanly ... OK ** checking loading without being on the library search path ... OK * loading checks for arch 'x64' ** checking whether the package can be loaded ... OK ** checking whether the package can be loaded with stated dependencies ... OK ** checking whether the package can be unloaded cleanly ... OK ** checking whether the namespace can be loaded with stated dependencies ... OK ** checking whether the namespace can be unloaded cleanly ... OK ** checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking compiled code ... OK * checking examples ... ** running examples for arch 'i386' ... ERROR Running examples in 'wfe-Ex.R' failed The error most likely occurred in: > ### Name: pwfe > ### Title: Fitting the Weighted Fixed Effects Model with Propensity Score > ### Weighting > ### Aliases: pwfe > ### Keywords: regression > > ### ** Examples > > ### NOTE: this example illustrates the use of wfe function with randomly > ### generated panel data with arbitrary number of units and time. > > ## generate panel data with number of units = N, number of time = Time > N <- 10 # number of distinct units > Time <- 15 # number of distinct time > > ## generate treatment variable > treat <- matrix(rbinom(N*Time, size = 1, 0.25), ncol = N) > ## make sure at least one observation is treated for each unit > while ((sum(apply(treat, 2, mean) == 0) > 0) | (sum(apply(treat, 2, mean) == 1) > 0) | + (sum(apply(treat, 1, mean) == 0) > 0) | (sum(apply(treat, 1, mean) == 1) > 0)) { + treat <- matrix(rbinom(N*Time, size = 1, 0.25), ncol = N) + } > treat.vec <- c(treat) > > ## unit fixed effects > alphai <- rnorm(N, mean = apply(treat, 2, mean)) > > ## geneate two random covariates > x1 <- matrix(rnorm(N*Time, 0.5,1), ncol=N) > x2 <- matrix(rbeta(N*Time, 5,1), ncol=N) > pscore <- matrix(runif(N*Time, 0,1), ncol=N) > x1.vec <- c(x1) > x2.vec <- c(x2) > pscore <- c(pscore) > > ## generate outcome variable > y <- matrix(NA, ncol = N, nrow = Time) > for (i in 1:N) { + y[, i] <- alphai[i] + treat[, i] + x1[,i] + x2[,i] + rnorm(Time) + } > y.vec <- c(y) > > ## generate unit and time index > unit.index <- rep(1:N, each = Time) > time.index <- rep(1:Time, N) > > Data.str <- as.data.frame(cbind(y.vec, treat.vec, unit.index, x1.vec, x2.vec)) > colnames(Data.str) <- c("y", "tr", "strata.id", "x1", "x2") > > Data.obs <- as.data.frame(cbind(y.vec, treat.vec, unit.index, time.index, x1.vec, x2.vec, pscore)) > colnames(Data.obs) <- c("y", "tr", "unit", "time", "x1", "x2", "pscore") > > > ############################################################ > # Example 1: Stratified Randomized Experiments > ############################################################ > > ## run the weighted fixed effect regression with strata fixed effect. > ## Note: the quantity of interest is Average Treatment Effect ("ate") > ## and the standard errors allow heteroskedasticity and arbitrary > ## autocorrelation. > > > ### Average Treatment Effect > ps.ate <- pwfe(~ x1+x2, treat = "tr", outcome = "y", data = Data.str, + unit.index = "strata.id", method = "unit", within.unit = TRUE, + qoi = "ate", hetero.se=TRUE, auto.se=TRUE) Number of unique unit is 10 Propensity Score estimation started based on the following model: tr ~ -1 + x1 + x2 Error: could not find function "anyNA" Execution halted ** running examples for arch 'x64' ... ERROR Running examples in 'wfe-Ex.R' failed The error most likely occurred in: > ### Name: pwfe > ### Title: Fitting the Weighted Fixed Effects Model with Propensity Score > ### Weighting > ### Aliases: pwfe > ### Keywords: regression > > ### ** Examples > > ### NOTE: this example illustrates the use of wfe function with randomly > ### generated panel data with arbitrary number of units and time. > > ## generate panel data with number of units = N, number of time = Time > N <- 10 # number of distinct units > Time <- 15 # number of distinct time > > ## generate treatment variable > treat <- matrix(rbinom(N*Time, size = 1, 0.25), ncol = N) > ## make sure at least one observation is treated for each unit > while ((sum(apply(treat, 2, mean) == 0) > 0) | (sum(apply(treat, 2, mean) == 1) > 0) | + (sum(apply(treat, 1, mean) == 0) > 0) | (sum(apply(treat, 1, mean) == 1) > 0)) { + treat <- matrix(rbinom(N*Time, size = 1, 0.25), ncol = N) + } > treat.vec <- c(treat) > > ## unit fixed effects > alphai <- rnorm(N, mean = apply(treat, 2, mean)) > > ## geneate two random covariates > x1 <- matrix(rnorm(N*Time, 0.5,1), ncol=N) > x2 <- matrix(rbeta(N*Time, 5,1), ncol=N) > pscore <- matrix(runif(N*Time, 0,1), ncol=N) > x1.vec <- c(x1) > x2.vec <- c(x2) > pscore <- c(pscore) > > ## generate outcome variable > y <- matrix(NA, ncol = N, nrow = Time) > for (i in 1:N) { + y[, i] <- alphai[i] + treat[, i] + x1[,i] + x2[,i] + rnorm(Time) + } > y.vec <- c(y) > > ## generate unit and time index > unit.index <- rep(1:N, each = Time) > time.index <- rep(1:Time, N) > > Data.str <- as.data.frame(cbind(y.vec, treat.vec, unit.index, x1.vec, x2.vec)) > colnames(Data.str) <- c("y", "tr", "strata.id", "x1", "x2") > > Data.obs <- as.data.frame(cbind(y.vec, treat.vec, unit.index, time.index, x1.vec, x2.vec, pscore)) > colnames(Data.obs) <- c("y", "tr", "unit", "time", "x1", "x2", "pscore") > > > ############################################################ > # Example 1: Stratified Randomized Experiments > ############################################################ > > ## run the weighted fixed effect regression with strata fixed effect. > ## Note: the quantity of interest is Average Treatment Effect ("ate") > ## and the standard errors allow heteroskedasticity and arbitrary > ## autocorrelation. > > > ### Average Treatment Effect > ps.ate <- pwfe(~ x1+x2, treat = "tr", outcome = "y", data = Data.str, + unit.index = "strata.id", method = "unit", within.unit = TRUE, + qoi = "ate", hetero.se=TRUE, auto.se=TRUE) Number of unique unit is 10 Propensity Score estimation started based on the following model: tr ~ -1 + x1 + x2 Error: could not find function "anyNA" Execution halted