diffr: Tests whether differences between pairs of model parameters...

View source: R/diffr.R

diffrR Documentation

Tests whether differences between pairs of model parameters are significant or not.

Description

The function finds the standard error of the difference between the two coefficients in terms of their variances and their covariance: myse <- (sqrt(myvar1 + myvar2 - 2*mycov))

It then proceeds to calculate a z-statistic: myz <- (mycoefdiff)/myse

A z-statistic of 1.96 or greater would indicate that the difference between the coefficients is significant at the 95% level of confidence.

The index numbers are based on the model coefficient table that comes straight out of the model, with no sorting.

The function will return a one-row dataframe with the following columns: var1, var2, coefindex1, coefindex2, mycoef1, mycoef2, mycoefdiff, myz, myp, lower95ci, upper95ci

A coefficient index of 0 will be interpreted as referring to the omitted constant.

Usage

diffr(coeftable = NULL, vcovmat = NULL, coefindex1 = NULL, coefindex2 = NULL)

Arguments

coeftable

coefficients table from mlogit, with one row per coefficient

vcovmat

variance covariance matrix from mlogit, with one row and one column per coefficient

coefindex1

index number of first coefficient to be tested

coefindex2

index number of second coefficient to be tested

Examples

mytest <- diffr(coeftable = results_ml_Repeatr4, vcovmat = vcovmat_ml_Repeatr4, coefindex1 = 1, coefindex2 = 2)


alexmitrani/Repeatr documentation built on June 11, 2024, 1:42 p.m.