par.t.test {desk}R Documentation

t-Test on Estimated Parameters of a Linear Model

Description

Performs a t-test on a single parameter hypothesis or a hypothesis containing a linear combination of parameters of a linear model. The object of test results returned by this command can be plotted using the plot() function.

Usage

par.t.test(
  mod,
  data = list(),
  nh,
  q = 0,
  dir = c("both", "left", "right"),
  sig.level = 0.05,
  details = FALSE,
  hyp = TRUE
)

Arguments

mod

model object estimated by ols() or lm().

data

name of the data frame to be used if mod is a formula and the variables are not present in the environment.

nh

vector of the coefficients of the linear combination of parameters.

q

value on which parameter (combination) is to be tested against. Default value: q = 0.

dir

direction of the hypothesis: "both", "left", "right", Default value: "both".

sig.level

significance level. Default value: sig.level = 0.05.

details

logical value indicating whether specific details about the test should be returned.

hyp

logical value indicating whether the Hypotheses should be returned.

Value

A list object including:

hyp character matrix of hypotheses (if hyp = TRUE).
nh null hypothesis as parameters of a linear combination (for internal purposes).
lcomb the linear combination of parameters tested.
results a data frame of basic test results.
std.err standard error of the linear estimator.
nulldist type of the null distribution with its parameters.

Examples

## Test H1: "phos + nit <> 1"
fert.est <- ols(barley ~ phos + nit, data = log(data.fertilizer))
x = par.t.test(fert.est, nh = c(0,1,1), q = 1, details = TRUE)
x # Show the test results

plot(x) # Visualize the test result

## Test H1: "phos > 0.5"
x = par.t.test(fert.est, nh = c(0,1,0), q = 0.5, dir = "right")
plot(x)


[Package desk version 1.1.1 Index]