"multiPIM"
objects (which result from calling either the multiPIM
or the multiPIMboot
function). Summaries may be of type "statistical", "time" or "both" (default). Statistical summaries contain, for each exposure-outcome pair, the parameter estimate, the standard error, the test statistic, the unadjusted p-value, and the Bonferroni-adjusted p-value. Time summaries contain a breakdown by g vs. Q modeling, and (if super learning was used to generate the "multiPIM"
object) by super learner candidate, of the time taken to run multiPIM
."summary"(object, type = c("both", "statistical", "time"), use.plug.in.se = is.null(object$boot.param.array), alternative.se.matrix = NULL, two.sided.p.vals = TRUE, bf.multiplier = object$num.exp * object$num.out, by.exposure = TRUE, digits = 4, ...)
"print"(x, by.exposure, digits, ...)
"multiPIM"
(the result of a call to multiPIM
or multiPIMboot
) to be summarized.TRUE
when object
is the result of a call to multiPIM
, and to FALSE
when object
is the result of a call to multiPIMboot
, in which case the bootstrap standard errors are used to calculate test statistics and p-values. This argument is ignored when alternative.se.matrix
is non-null.multiPIM
) or bootstrap (from multiPIMboot
). Must have dim
attribute equal to that of object$param.estimates
and corresponding elements will be assumed to match up.TRUE
), or one-sided (for FALSE
).TRUE
, the default), or each outcome (for FALSE
). The by.exposure
argument to the print method, if given, will override the one specified when the summary was generated with the summary method.print.default
when and if the summary object is printed. The digits
argument to the print method, if given, will override the one specified when the summary was generated with the summary method."summary.multiPIM"
(the result of a call to the summary method) to be printed.print.default
."summary.multiPIM"
, which will have different slots depending on the value of the type
argument.The object will always have the following slots (regardless of the value of type
):print.default
when this object is printed."multiPIM"
object on which the summary method was called.type
is "statistical"
or "both"
, the result of summary will in addition have the following slots:TRUE
) or one-sided (for FALSE
)."plug.in"
, "bootstrap"
, or "alternative"
.TRUE
) or by outcome (for FALSE
).summary.array
slot: the first dimension corresponds to the exposures (columns of A from the "multiPIM"
object for which the summary is being generated), the second dimension to the outcomes (columns of Y) and the third dimension has length 5 and corresponds to the 5 relevant attributes for each exposure-outcome pair (i.e. the parameter estimate, the standard error of that estimate, the test statistic, the unadjusted p-value and the Bonferroni-adjusted p-value, in that order). Thus, summary.array[1,2,3]
would be the test statistic for the pair consisting of the first exposure (first column of A) and the 2nd outcome (2nd column of Y), while summary.array[3,2,1]
would be the parameter estimate for the pair consisting of the 3rd exposure and the 2nd outcome. To access the matrix containing all unadjusted p-values, use summary.array[,,4]
, to access the matrix consisting of everything that involves the fourth outcome use summary.array[,4,]
.If type
is "time"
or "both"
, the result of summary will in addition have the following slots:x
, which should be an object of class "summary.multiPIM"
) invisibly.
multiPIM
and multiPIMboot
## load example from multiPIM help file
example(multiPIM)
## The results can also be displayed by outcome instead of by exposure:
summary(result, by.exposure = FALSE)
## now each table corresponds to all the pairs involving a single outcome
## may be best to store the summary object
sum.obj <- summary(result, by.exposure = FALSE)
sum.obj
## now the print method can be used to overide the values for
## by.exposure and digits (but not the other arguments):
print(sum.obj, by.exposure = TRUE, digits = 3)
## also can hand pick the info that we want from the summary.array slot
## e.g. let's say we are interested in all of the standard errors:
sum.obj$summary.array[,,2]
## or we are only interested in the exposure1-outcome2 pair:
sum.obj$summary.array[1,2,]
## or by name
sum.obj$summary.array["A1","Y2",]
Run the code above in your browser using DataLab