diffr | R Documentation |
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.
diffr(coeftable = NULL, vcovmat = NULL, coefindex1 = NULL, coefindex2 = NULL)
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 |
mytest <- diffr(coeftable = results_ml_Repeatr4, vcovmat = vcovmat_ml_Repeatr4, coefindex1 = 1, coefindex2 = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.