ttest: T-Test

Description Usage Arguments Value Examples

Description

Obtain the T-value and P-value for any parameter in a model, given a hypothesised mean.

Usage

1
ttest(var_name, df, model, pop_mean = 0)

Arguments

var_name

the variable to find the t-value for, in the form "educ" or "exper" etc.

df

the dataframe which the model is based upon, e.g. my_data or NASA.

model

the model which the parameter pertains to, e.g. my_model or chow_model.

pop_mean

the value which the population mean is hypothesised to be, typically 0.

Value

The output from print, giving the T-Value and P-Value.

Examples

1
2
3
4
5
6
7
8
file = system.file("extdata", "hseinv.txt", package="Kenometrics")
data <- read.delim(file)
linear_model <- lm(linv ~ lpop + lprice, data=data)
ttest("lpop", data, linear_model, 0)
## Not run: 
ttest("educ", my_df, chow_model, 1)

## End(Not run)

pointonjoel/Kenometrics documentation built on Jan. 24, 2021, 6:05 a.m.