Skip to contents

Computes confidence intervals for one or more parameters of a fitted model.

Usage

# S3 method for class 'slcafit'
confint(object, parm, level = 0.95, type = c("param", "logit"), ...)

Arguments

object

an object of class slcafit.

parm

an integer or string specifying the parameters for which confidence intervals are to be computed.

level

a numeric value representing the confidence level for the intervals. The default is 0.95 (95% confidence level).

type

a character string specifying the format in which the results should be returned. Options include "probs" for probability format and "logit" for log-odds (logit) format, with the default being "probs".

...

additional arguments.

Value

A matrix with two columns representing the confidence intervals for the selected parameters. The column names correspond to the specified confidence level:

  • 100 * (level / 2)%: The lower bound of the confidence interval.

  • 100 * (1 - level / 2)%: The upper bound of the confidence interval.

The level argument determines the confidence level, with common values being 0.95 for a 95% confidence interval and 0.99 for a 99% confidence interval.

Examples

param(nlsy_jlcpa, index = TRUE)
#> PI :
#> (PROF)
#>   class
#>              1           2           3           4
#>     0.2790 (1)  0.2146 (2)  0.2869 (3)  0.2195 (4)
#> 
#> TAU :
#> (A)
#>      parent
#> child           1            2            3            4
#>     1  0.0000 (5)  0.0000 (10)  0.1745 (15)  0.0000 (20)
#>     2  0.0901 (6)  0.4456 (11)  0.1939 (16)  0.0403 (21)
#>     3  0.3771 (7)  0.1675 (12)  0.1825 (17)  0.7018 (22)
#>     4  0.2620 (8)  0.0000 (13)  0.0000 (18)  0.0813 (23)
#>     5  0.2709 (9)  0.3869 (14)  0.4491 (19)  0.1766 (24)
#>              
#> parent PROF  
#> child  SUB_98
#> (B)
#>      parent
#> child            1            2            3            4
#>     1  0.0000 (25)  0.0114 (30)  0.8719 (35)  0.0000 (40)
#>     2  0.0000 (26)  0.9617 (31)  0.0000 (36)  0.0079 (41)
#>     3  0.0000 (27)  0.0000 (32)  0.0965 (37)  0.9210 (42)
#>     4  0.9941 (28)  0.0000 (33)  0.0000 (38)  0.0711 (43)
#>     5  0.0059 (29)  0.0269 (34)  0.0316 (39)  0.0000 (44)
#>              
#> parent PROF  
#> child  SUB_03
#> (C)
#>      parent
#> child            1            2            3            4
#>     1  0.0019 (45)  0.1821 (50)  0.8024 (55)  0.0319 (60)
#>     2  0.0097 (46)  0.7202 (51)  0.0000 (56)  0.0000 (61)
#>     3  0.0573 (47)  0.0442 (52)  0.1844 (57)  0.7168 (62)
#>     4  0.9311 (48)  0.0356 (53)  0.0084 (58)  0.2473 (63)
#>     5  0.0000 (49)  0.0179 (54)  0.0048 (59)  0.0040 (64)
#>              
#> parent PROF  
#> child  SUB_08
#> (D)
#>      parent
#> child            1            2            3            4            5
#>     1  0.0254 (65)  0.0457 (68)  0.9505 (71)  0.7958 (74)  0.1613 (77)
#>     2  0.7516 (66)  0.6690 (69)  0.0051 (72)  0.0000 (75)  0.1631 (78)
#>     3  0.2230 (67)  0.2853 (70)  0.0444 (73)  0.2042 (76)  0.6755 (79)
#>                            
#> parent SUB_98 SUB_03 SUB_08
#> child  SMK_98 SMK_03 SMK_08
#> (E)
#>      parent
#> child            1            2            3            4            5
#>     1  0.5664 (80)  0.8533 (83)  0.0335 (86)  0.7521 (89)  0.2872 (92)
#>     2  0.2229 (81)  0.1264 (84)  0.2589 (87)  0.2414 (90)  0.6127 (93)
#>     3  0.2107 (82)  0.0203 (85)  0.7075 (88)  0.0065 (91)  0.1001 (94)
#>                            
#> parent SUB_98 SUB_03 SUB_08
#> child  DRK_98 DRK_03 DRK_08
#> (F)
#>      parent
#> child            1             2             3             4             5
#>     1  0.0871 (95)   0.1442 (98)  0.0317 (101)  0.1525 (104)  0.7278 (107)
#>     2  0.0617 (96)   0.8387 (99)  0.0095 (102)  0.2302 (105)  0.1258 (108)
#>     3  0.8512 (97)  0.0170 (100)  0.9588 (103)  0.6173 (106)  0.1463 (109)
#>                            
#> parent SUB_98 SUB_03 SUB_08
#> child  MRJ_98 MRJ_03 MRJ_08
#> 
#> RHO :
#> (a)
#>         class
#> response             1             2             3
#>    1(V1)  0.0134 (110)  1.0000 (118)  1.0000 (126)
#>    2      0.9866 (111)  0.0000 (119)  0.0000 (127)
#>    1(V2)  0.0000 (112)  1.0000 (120)  0.6701 (128)
#>    2      1.0000 (113)  0.0000 (121)  0.3299 (129)
#>    1(V3)  0.0000 (114)  0.8833 (122)  0.0000 (130)
#>    2      1.0000 (115)  0.1167 (123)  1.0000 (131)
#>    1(V4)  0.0000 (116)  0.6460 (124)  0.0000 (132)
#>    2      1.0000 (117)  0.3540 (125)  1.0000 (133)
#> 
#>        V1      V2      V3      V4     
#> SMK_98 ESMK_98 FSMK_98 DSMK_98 HSMK_98
#> SMK_03 ESMK_03 FSMK_03 DSMK_03 HSMK_03
#> SMK_08 ESMK_08 FSMK_08 DSMK_08 HSMK_08
#> (b)
#>         class
#> response             1             2             3
#>    1(V1)  1.0000 (134)  1.0000 (142)  0.0759 (150)
#>    2      0.0000 (135)  0.0000 (143)  0.9241 (151)
#>    1(V2)  1.0000 (136)  0.5760 (144)  0.0000 (152)
#>    2      0.0000 (137)  0.4240 (145)  1.0000 (153)
#>    1(V3)  0.6934 (138)  0.0000 (146)  0.0000 (154)
#>    2      0.3066 (139)  1.0000 (147)  1.0000 (155)
#>    1(V4)  0.8061 (140)  0.0000 (148)  0.0000 (156)
#>    2      0.1939 (141)  1.0000 (149)  1.0000 (157)
#> 
#>        V1      V2      V3      V4     
#> DRK_98 EDRK_98 CDRK_98 WDRK_98 BDRK_98
#> DRK_03 EDRK_03 CDRK_03 WDRK_03 BDRK_03
#> DRK_08 EDRK_08 CDRK_08 WDRK_08 BDRK_08
#> (c)
#>         class
#> response             1             2             3
#>    1(V1)  0.5189 (158)  1.0000 (166)  0.0002 (174)
#>    2      0.4811 (159)  0.0000 (167)  0.9998 (175)
#>    1(V2)  0.0000 (160)  1.0000 (168)  0.0000 (176)
#>    2      1.0000 (161)  0.0000 (169)  1.0000 (177)
#>    1(V3)  0.0000 (162)  0.5259 (170)  0.0000 (178)
#>    2      1.0000 (163)  0.4741 (171)  1.0000 (179)
#>    1(V4)  0.0000 (164)  0.3720 (172)  0.0000 (180)
#>    2      1.0000 (165)  0.6280 (173)  1.0000 (181)
#> 
#>        V1      V2      V3      V4     
#> MRJ_98 EMRJ_98 CMRJ_98 OMRJ_98 SMRJ_98
#> MRJ_03 EMRJ_03 CMRJ_03 OMRJ_03 SMRJ_03
#> MRJ_08 EMRJ_08 CMRJ_08 OMRJ_08 SMRJ_08
confint(nlsy_jlcpa)
#>               2.5 %        97.5 %
#> (1)    2.375946e-01  3.189674e-01
#> (2)    2.007809e-01  2.232185e-01
#> (3)    2.694779e-01  2.972918e-01
#> (4)    2.921466e-01  1.605223e-01
#> (5)   3.225019e-147 1.301357e-147
#> (6)    5.617668e-02  1.323912e-01
#> (7)    3.342859e-01  3.900330e-01
#> (8)    2.011686e-01  3.127912e-01
#> (9)    4.083688e-01  1.647846e-01
#> (10)   1.405540e-17  7.178229e-18
#> (11)   3.571926e-01  5.169822e-01
#> (12)   1.206630e-01  2.163536e-01
#> (13)   5.905230e-09  3.015863e-09
#> (14)   5.221444e-01  2.666642e-01
#> (15)   1.160137e-01  2.395351e-01
#> (16)   1.437584e-01  2.388426e-01
#> (17)   1.424657e-01  2.135349e-01
#> (18)   4.364059e-25  2.249242e-25
#> (19)   5.977622e-01  3.080874e-01
#> (20)   2.991425e-80  8.182306e-81
#> (21)   1.641842e-02  8.540367e-02
#> (22)   6.334481e-01  6.715708e-01
#> (23)   3.635955e-02  1.572004e-01
#> (24)   3.137739e-01  8.582514e-02
#> (25)   6.296108e-25  1.585150e-31
#> (26)   5.606658e-74  1.411570e-80
#> (27)   1.740577e-05  4.382324e-12
#> (28)   7.075207e-03  9.999998e-01
#> (29)   9.929074e-01  2.499810e-07
#> (30)   2.418619e-06  9.752161e-01
#> (31)   6.781348e-01  2.474301e-02
#> (32)  1.820277e-198 2.313017e-202
#> (33)   5.547786e-99 7.049545e-103
#> (34)   3.218627e-01  4.089894e-05
#> (35)   7.167324e-01  8.866895e-01
#> (36)   7.776363e-11  1.443907e-12
#> (37)   7.116396e-02  1.093721e-01
#> (38)   2.824285e-81  5.244104e-83
#> (39)   2.121036e-01  3.938319e-03
#> (40)   4.381807e-25  7.093169e-27
#> (41)   1.526174e-03  3.898913e-02
#> (42)   9.603969e-01  8.353983e-01
#> (43)   3.807697e-02  1.256126e-01
#> (44)   7.213316e-48  1.167675e-49
#> (45)   7.231773e-06  3.313218e-01
#> (46)   3.926489e-03  1.594934e-02
#> (47)   5.449962e-02  4.002355e-02
#> (48)   9.415667e-01  6.127054e-01
#> (49)  4.610415e-128 8.887994e-131
#> (50)   1.272757e-01  2.008492e-01
#> (51)   5.846055e-01  6.838233e-01
#> (52)   2.743692e-02  5.478871e-02
#> (53)   1.643153e-02  5.952959e-02
#> (54)   2.442503e-01  1.009236e-03
#> (55)   2.347775e-03  7.502790e-01
#> (56)   1.320936e-37  8.332838e-45
#> (57)   5.573460e-04  1.668778e-01
#> (58)   2.331151e-06  8.284316e-02
#> (59)   9.970925e-01  6.289942e-08
#> (60)   8.559811e-04  4.301559e-02
#> (61)  1.742218e-229 1.081342e-235
#> (62)   2.692763e-02  6.901381e-01
#> (63)   8.292467e-03  2.668457e-01
#> (64)   9.639239e-01  5.982781e-07
#> (65)   5.489069e-03  1.078415e-01
#> (66)   7.041832e-01  7.352459e-01
#> (67)   2.903277e-01  1.569126e-01
#> (68)   2.886795e-02  7.092989e-02
#> (69)   6.297945e-01  6.957045e-01
#> (70)   3.413375e-01  2.333657e-01
#> (71)   9.120412e-01  9.441569e-01
#> (72)   7.185928e-04  3.425526e-02
#> (73)   8.724023e-02  2.158784e-02
#> (74)   7.451601e-01  8.386085e-01
#> (75)   1.936013e-11  1.226088e-11
#> (76)   2.548399e-01  1.613915e-01
#> (77)   1.079444e-01  2.272854e-01
#> (78)   1.140801e-01  2.198554e-01
#> (79)   7.779755e-01  5.528592e-01
#> (80)   5.432810e-01  5.817225e-01
#> (81)   1.948651e-01  2.511782e-01
#> (82)   2.618540e-01  1.670994e-01
#> (83)   8.341752e-01  8.568705e-01
#> (84)   1.162206e-01  1.350051e-01
#> (85)   4.960417e-02  8.124423e-03
#> (86)   7.167025e-03  1.392989e-01
#> (87)   1.960327e-01  3.034219e-01
#> (88)   7.968002e-01  5.572792e-01
#> (89)   6.932064e-01  7.597046e-01
#> (90)   2.262974e-01  2.398108e-01
#> (91)   8.049620e-02  4.846526e-04
#> (92)   2.513875e-01  3.152499e-01
#> (93)   5.725251e-01  6.300458e-01
#> (94)   1.760875e-01  5.470427e-02
#> (95)   4.059992e-02  1.707237e-01
#> (96)   2.983669e-02  1.167917e-01
#> (97)   9.295634e-01  7.124847e-01
#> (98)   1.607779e-01  1.199931e-01
#> (99)   7.435855e-01  8.772025e-01
#> (100)  9.563661e-02  2.804361e-03
#> (101)  1.242393e-02  7.739141e-02
#> (102)  3.305878e-03  2.629612e-02
#> (103)  9.842702e-01  8.963125e-01
#> (104)  9.321312e-02  2.376499e-01
#> (105)  2.070434e-01  2.436557e-01
#> (106)  6.997435e-01  5.186944e-01
#> (107)  2.345068e-01  8.823160e-01
#> (108)  5.841169e-02  1.058530e-01
#> (109)  7.070815e-01  1.183098e-02
#> (110)  2.765600e-03  6.228101e-02
#> (111)  9.972344e-01  9.377190e-01
#> (112)  0.000000e+00  0.000000e+00
#> (113)  1.000000e+00  1.000000e+00
#> (114)  0.000000e+00  0.000000e+00
#> (115)  1.000000e+00  1.000000e+00
#> (116)  0.000000e+00  0.000000e+00
#> (117)  1.000000e+00  1.000000e+00
#> (118)  1.000000e+00  1.000000e+00
#> (119)  0.000000e+00  0.000000e+00
#> (120)  1.000000e+00  1.000000e+00
#> (121)  0.000000e+00  0.000000e+00
#> (122)  8.509914e-01  9.093172e-01
#> (123)  1.490086e-01  9.068277e-02
#> (124)  6.145998e-01  6.762846e-01
#> (125)  3.854002e-01  3.237154e-01
#> (126)  1.000000e+00  1.000000e+00
#> (127)  0.000000e+00  0.000000e+00
#> (128)  6.165459e-01  7.194874e-01
#> (129)  3.834541e-01  2.805126e-01
#> (130)  0.000000e+00  0.000000e+00
#> (131)  1.000000e+00  1.000000e+00
#> (132)  0.000000e+00  0.000000e+00
#> (133)  1.000000e+00  1.000000e+00
#> (134)  1.000000e+00  1.000000e+00
#> (135)  0.000000e+00  0.000000e+00
#> (136)  1.000000e+00  1.000000e+00
#> (137)  0.000000e+00  0.000000e+00
#> (138)  6.659175e-01  7.195506e-01
#> (139)  3.340825e-01  2.804494e-01
#> (140)  7.816957e-01  8.283861e-01
#> (141)  2.183043e-01  1.716139e-01
#> (142)  1.000000e+00  1.000000e+00
#> (143)  0.000000e+00  0.000000e+00
#> (144)  5.142454e-01  6.355153e-01
#> (145)  4.857546e-01  3.644847e-01
#> (146) 2.266886e-173 2.266886e-173
#> (147)  1.000000e+00  1.000000e+00
#> (148) 3.659486e-127 3.659486e-127
#> (149)  1.000000e+00  1.000000e+00
#> (150)  2.533073e-02  2.062544e-01
#> (151)  9.746693e-01  7.937456e-01
#> (152)  0.000000e+00  0.000000e+00
#> (153)  1.000000e+00  1.000000e+00
#> (154)  0.000000e+00  0.000000e+00
#> (155)  1.000000e+00  1.000000e+00
#> (156)  0.000000e+00  0.000000e+00
#> (157)  1.000000e+00  1.000000e+00
#> (158)  3.209799e-01  7.110619e-01
#> (159)  6.790201e-01  2.889381e-01
#> (160) 9.689486e-106 9.689486e-106
#> (161)  1.000000e+00  1.000000e+00
#> (162)  0.000000e+00  0.000000e+00
#> (163)  1.000000e+00  1.000000e+00
#> (164)  0.000000e+00  0.000000e+00
#> (165)  1.000000e+00  1.000000e+00
#> (166)  1.000000e+00  1.000000e+00
#> (167)  0.000000e+00  0.000000e+00
#> (168)  1.000000e+00  1.000000e+00
#> (169)  0.000000e+00  0.000000e+00
#> (170)  4.824858e-01  5.688752e-01
#> (171)  5.175142e-01  4.311248e-01
#> (172)  3.328567e-01  4.129556e-01
#> (173)  6.671433e-01  5.870444e-01
#> (174)  2.280080e-04  2.354544e-04
#> (175)  9.997720e-01  9.997645e-01
#> (176)  0.000000e+00  0.000000e+00
#> (177)  1.000000e+00  1.000000e+00
#> (178)  0.000000e+00  0.000000e+00
#> (179)  1.000000e+00  1.000000e+00
#> (180)  0.000000e+00  0.000000e+00
#> (181)  1.000000e+00  1.000000e+00
confint(nlsy_jlcpa, 1:4)
#>         2.5 %    97.5 %
#> (1) 0.2375946 0.3189674
#> (2) 0.2007809 0.2232185
#> (3) 0.2694779 0.2972918
#> (4) 0.2921466 0.1605223