Learn R Programming

asremlPlus (version 4.2-26)

getTestPvalue.asrtests: Gets the p-value for a test recorded in the test.summary data.frame of an asrtests.object

Description

Matches the label in the term column of the test.summary data.frame in the supplied asrtests.object and extracts the its p-value. It only matches the first occurence of label.

Usage

# S3 method for asrtests
getTestPvalue(asrtests.obj, label, ...)

Arguments

asrtests.obj

An asrtests.object containing the components (i) asreml.obj, (ii) wald.tab, and (iii) test.summary.

label

A character specifying the label of the test for which the p-value is required. If testranfix.asrtests was used for the test of interest, then the label will be the value of the term argument supplied to testranfix.asrtests.

provision for passsing arguments to functions called internally - not used at present.

Value

An numeric containing the p-value. It can be NA, for example when a p-value could not be calculated.

See Also

as.asrtests, testranfix.asrtests, testswapran.asrtests, testresidual.asrtests, changeTerms.asrtests, chooseModel.asrtests

Examples

Run this code
# NOT RUN {
data(Wheat.dat)
current.asr <- asreml(yield ~ Rep + WithinColPairs + Variety, 
                      random = ~ Row + Column + units,
                      residual = ~ ar1(Row):ar1(Column), 
                      data=Wheat.dat)
current.asrt <- as.asrtests(current.asr, NULL, NULL)
current.asrt <- rmboundary(current.asrt)
# Test nugget term
current.asrt <- testranfix(current.asrt, "units", positive=TRUE)
getTestPvalue(current.asrt, label = "units")
# }

Run the code above in your browser using DataLab