Last updated on 2018-07-14 19:46:58 CEST.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 3.2.2 | 2.66 | 29.79 | 32.45 | ERROR | |
r-devel-linux-x86_64-debian-gcc | 3.2.2 | 1.96 | 23.71 | 25.67 | ERROR | |
r-devel-linux-x86_64-fedora-clang | 3.2.2 | 39.41 | NOTE | |||
r-devel-linux-x86_64-fedora-gcc | 3.2.2 | 38.40 | NOTE | |||
r-devel-windows-ix86+x86_64 | 3.2.2 | 7.00 | 40.00 | 47.00 | NOTE | |
r-patched-linux-x86_64 | 3.2.2 | 2.69 | 28.70 | 31.39 | ERROR | |
r-patched-solaris-x86 | 3.2.2 | 56.50 | NOTE | |||
r-release-linux-x86_64 | 3.2.2 | 2.64 | 28.63 | 31.27 | ERROR | |
r-release-windows-ix86+x86_64 | 3.2.2 | 8.00 | 38.00 | 46.00 | NOTE | |
r-release-osx-x86_64 | 3.2.2 | NOTE | ||||
r-oldrel-windows-ix86+x86_64 | 3.2.2 | 4.00 | 43.00 | 47.00 | NOTE | |
r-oldrel-osx-x86_64 | 3.2.2 | NOTE |
Version: 3.2.2
Check: R code for possible problems
Result: NOTE
E.2SI: no visible binding for global variable ‘var’
E.2SI: no visible global function definition for ‘var’
E.BE: no visible global function definition for ‘var’
E.Beta: no visible global function definition for ‘var’
E.PO: no visible global function definition for ‘var’
E.PPS: no visible global function definition for ‘var’
E.SI: no visible global function definition for ‘var’
E.STPPS: no visible global function definition for ‘var’
E.STSI: no visible global function definition for ‘var’
E.STpiPS: no visible global function definition for ‘var’
E.SY: no visible global function definition for ‘var’
E.WR: no visible global function definition for ‘var’
E.piPS: no visible global function definition for ‘var’
GREG.SI: no visible global function definition for ‘var’
S.BE: no visible global function definition for ‘runif’
S.PO: no visible global function definition for ‘runif’
S.PPS: no visible global function definition for ‘runif’
S.SI: no visible global function definition for ‘runif’
S.STPPS: no visible global function definition for ‘runif’
S.WR: no visible global function definition for ‘rbinom’
S.piPS: no visible global function definition for ‘runif’
p.WR: no visible global function definition for ‘dmultinom’
Undefined global functions or variables:
dmultinom rbinom runif var
Consider adding
importFrom("stats", "dmultinom", "rbinom", "runif", "var")
to your NAMESPACE file.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64
Version: 3.2.2
Check: examples
Result: ERROR
Running examples in ‘TeachingSampling-Ex.R’ failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: HH
> ### Title: The Hansen-Hurwitz Estimator
> ### Aliases: HH
> ### Keywords: survey
>
> ### ** Examples
>
> ############
> ## Example 1
> ############
> # Vector U contains the label of a population of size N=5
> U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
> # Vectors y1 and y2 give the values of the variables of interest
> y1<-c(32, 34, 46, 89, 35)
> y2<-c(1,1,1,0,0)
> y3<-cbind(y1,y2)
> # The population size is N=5
> N <- length(U)
> # The sample size is m=2
> m <- 2
> # pk is the probability of selection of every single unit
> pk <- c(0.35, 0.225, 0.175, 0.125, 0.125)
> # Selection of a random sample with replacement
> sam <- sample(5,2, replace=TRUE, prob=pk)
> # The selected sample is
> U[sam]
[1] "Yves" "Ken"
> # The values of the variables of interest for the units in the sample
> y1[sam]
[1] 32 34
> y2[sam]
[1] 1 1
> y3[sam,]
y1 y2
[1,] 32 1
[2,] 34 1
> # The Hansen-Hurwitz estimator
> HH(y1[sam],pk[sam])
y
Estimation 121.26984
Standard Error 29.84127
CVE 24.60733
> HH(y2[sam],pk[sam])
y
Estimation 3.6507937
Standard Error 0.7936508
CVE 21.7391304
> HH(y3[sam,],pk[sam])
y1 y2
Estimation 121.26984 3.6507937
Standard Error 29.84127 0.7936508
CVE 24.60733 21.7391304
>
>
> ############
> ## Example 2
> ############
> # Uses the Lucy data to draw a simple random sample with replacement
> data(Lucy)
> attach(Lucy)
>
> N <- dim(Lucy)[1]
> m <- 400
> sam <- sample(N,m,replace=TRUE)
> # The vector of selection probabilities of units in the sample
> pk <- rep(1/N,m)
> # The information about the units in the sample is stored in an object called data
> data <- Lucy[sam,]
> attach(data)
The following objects are masked from Lucy:
Employees, ID, Income, Level, SPAM, Taxes, Ubication, Zone
> names(data)
[1] "ID" "Ubication" "Level" "Zone" "Income" "Employees"
[7] "Taxes" "SPAM"
> # The variables of interest are: Income, Employees and Taxes
> # This information is stored in a data frame called estima
> estima <- data.frame(Income, Employees, Taxes)
> HH(estima, pk)
Income Employees Taxes
Estimation 1.004235e+06 1.496002e+05 26966.980000
Standard Error 3.128381e+04 3.715376e+03 1779.232304
CVE 3.115187e+00 2.483536e+00 6.597818
>
> ################################################################
> ## Example 3 HH is unbiased for with replacement sampling designs
> ################################################################
>
> # Vector U contains the label of a population of size N=5
> U <- c("Yves", "Ken", "Erik", "Sharon", "Leslie")
> # Vector y1 and y2 are the values of the variables of interest
> y<-c(32, 34, 46, 89, 35)
> # The population size is N=5
> N <- length(U)
> # The sample size is m=2
> m <- 2
> # pk is the probability of selection of every single unit
> pk <- c(0.35, 0.225, 0.175, 0.125, 0.125)
> # p is the probability of selection of every possible sample
> p <- p.WR(N,m,pk)
> p
[1] 0.122500 0.157500 0.122500 0.087500 0.087500 0.050625 0.078750 0.056250
[9] 0.056250 0.030625 0.043750 0.043750 0.015625 0.031250 0.015625
> sum(p)
[1] 1
> # The sample membership matrix for random size without replacement sampling designs
> Ind <- nk(N,m)
> Ind
[,1] [,2] [,3] [,4] [,5]
[1,] 2 0 0 0 0
[2,] 1 1 0 0 0
[3,] 1 0 1 0 0
[4,] 1 0 0 1 0
[5,] 1 0 0 0 1
[6,] 0 2 0 0 0
[7,] 0 1 1 0 0
[8,] 0 1 0 1 0
[9,] 0 1 0 0 1
[10,] 0 0 2 0 0
[11,] 0 0 1 1 0
[12,] 0 0 1 0 1
[13,] 0 0 0 2 0
[14,] 0 0 0 1 1
[15,] 0 0 0 0 2
> # The support with the values of the elements
> Qy <- SupportWR(N,m, ID=y)
Error in if (ID == FALSE) { : the condition has length > 1
Calls: SupportWR
Execution halted
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-patched-linux-x86_64, r-release-linux-x86_64