branchInference | R Documentation |
rpart
regression tree.Can be used to carry out inference on a pair of sibling regions or on a single region.
branchInference(
tree,
branch,
type = "reg",
alpha = 0.05,
sigma_y = NULL,
c = 0,
computeCI = TRUE,
permute = FALSE
)
tree |
An |
branch |
A vector of splits describing the branch that you wish to do inference on. You should obtain this using the function
'getBranch()'. Must actually correspond to a branch in |
type |
A string that should be set to either |
alpha |
Function will compute an equi-tailed |
sigma_y |
The true standard deviation of the response. If known, this should be passed in. Otherwise, the sample standard deviation will be used as a conservative estimate. |
c |
The p-value returned will test the null hypothesis that the parameter of interest is equal to c. Currently, only c=0 is a valid input. |
computeCI |
Boolean that specifies if you would like a confidence interval to be computed. Confidence intervals are much slower to compute than p-values, and so if you only wish to see a p-value you may want to set this to be false. |
permute |
Boolean. Only relevant if type="reg". If |
An object of class branch_inference
that contains a confidence interval, a p-value,
the sample statistic, the conditioning set, and a flag reminding the user if type="reg"
or type="sib"
.
bls.tree <- rpart::rpart(kcal24h0~hunger+disinhibition+resteating+rrvfood+liking+wanting,
model = TRUE, data = blsdata, cp=0.02)
branch <- getBranch(bls.tree, 8)
branchInference (bls.tree, branch, type="sib")
branchInference (bls.tree, branch, type="reg", permute=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.