Thanks, that's very helpful—the error is reprodxucible. The error message, ultimately, traces to stats::regularize.values()
by way of stats::approx()
to a function defined there
r <- regularize.values(x, y, ties, missing(ties), na.rm = na.r
and an interval variable nx
is set to the length of r$x
in the return value or, if that value is NA
to the number of rows. r$x
is the number of unique values of x
.
If there are no unique values of x
the error is zero non-NA points
, and if there is only one unique value of x
the message seen from confint(polrModel)
is seen
need at least two non-NA values to interpolate
See the source code.
Since we know from summary(Data)
that each variable has more than one unique value and because the argument to confint
is not Data
but the polr
object polrModel
, the next step would be to identify the model term that is being collapsed to a single unique value.
I didn't make progress directly, so the next resort was the similar model function rms::lrm
the results of which were identified to rms::validate
that identified smoking
as producing a singular information matrix
. As an empiricist, I removed smoking
from Data
and got
library(MASS)
Data <- structure(list(ï..Age = c(
31, 18, 33, 35, 21, 22, 20, 23, 19,
19, 34, 19, 21, 20, 18, 18, 31, 19, 19, 35, 23, 20, 23, 25, 31,
22, 21, 22, 25, 28, 20, 25, 27, 24, 19, 31, 20, 19, 31, 24, 32,
21, 33, 23, 29, 26, 18, 29, 21, 26, 21, 23, 24, 31, 20, 25, 26,
26, 35, 27, 28, 34, 34, 23, 27, 29, 35, 25, 31, 32, 34, 31, 32,
20, 33, 24, 30, 24, 30, 20, 26, 32, 24, 24, 26, 22, 25, 24, 22,
33, 25, 26, 28, 27, 25, 24, 22, 29, 27, 24, 22, 32, 27, 23, 19,
27, 25, 26, 27, 28, 28, 24, 35, 29, 24, 26, 20, 26, 22, 22, 28,
22, 19, 27, 30, 26, 25, 31, 34, 23, 24, 24, 33, 20, 24, 35, 26,
35, 34, 24, 33, 25, 29, 24, 23, 32, 35, 19, 21, 32, 26, 27, 29,
23, 25, 26, 30, 29, 29, 25, 23, 29, 27, 25, 35, 27, 24, 26, 28,
30, 30, 35, 25, 24, 28, 25, 34, 31
), N.BMI = structure(c(
2L,
2L, 3L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 4L, 2L, 4L,
2L, 3L, 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 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L,
1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 2L,
2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 2L,
1L
), .Label = c("0", "1"), class = "factor")), row.names = c(
NA,
-178L
), class = "data.frame")
# some suggestions for names used during analysis;
# for presentation, more expansive descriptors
# can be used. Many typos will be saved
# for example, except for the first column
# all begin with N. If there are similar datasets
# with "M.BMI", the data frames could be named
# N_data and M_data with identical variable names
# which makes script and snippet reuse simpler
# save existing variable names for use in presentation
# materials possibly
header <- colnames(Data)
# shorter, lowercase names
colnames(Data) <- c("age","bmi","horm_med","at_menses","regularity","bleeding","vape","alcohol","drug","sleep","caffeine","stress","chem_expos","smoking","psych_med","relationship","place_living","pregnancy","sexually_active","between_cycles","length_period","mental_health")
summary(Data)
#> age bmi horm_med at_menses regularity bleeding vape alcohol
#> Min. :18.00 0: 12 0:115 0:113 0:138 1:128 0:156 0:28
#> 1st Qu.:23.00 1:100 1: 57 1: 65 1: 40 2: 36 1: 8 1:61
#> Median :26.00 2: 41 2: 6 3: 14 2: 14 2:89
#> Mean :26.21 3: 25
#> 3rd Qu.:30.00
#> Max. :35.00
#> drug sleep caffeine stress chem_expos smoking psych_med relationship
#> 0:132 0:101 0:38 1: 37 0: 44 0:120 0:149 0:74
#> 1: 28 1: 61 1:78 2:122 1:107 1: 55 1: 29 1: 9
#> 2: 18 2: 16 2:57 3: 19 2: 27 2: 3 2:95
#> 3: 5
#>
#>
#> place_living pregnancy sexually_active between_cycles length_period
#> 0:98 0:139 0: 45 0:154 0:161
#> 1:61 1: 39 1:133 1: 24 1: 17
#> 2:19
#>
#>
#>
#> mental_health
#> 0: 71
#> 1:107
#>
#>
#>
#>
# for reasons explained in the narrative
# a model that omits the smoking variable
# does not produce the error
polrModel = polr(bleeding~.,data=Data[-14])
confint(polrModel)
#> Waiting for profiling to be done...
#>
#> Re-fitting to get Hessian
#> 2.5 % 97.5 %
#> age -0.22062704 0.04200941
#> bmi1 -3.13057222 -0.02298817
#> bmi2 -2.20830952 1.19419249
#> bmi3 -2.17081176 1.74613460
#> horm_med1 0.11222653 2.11067991
#> horm_med2 -2.43571533 2.17996759
#> at_menses1 -1.39101280 0.53289325
#> regularity1 0.73923102 3.20719625
#> vape1 0.43934323 6.33365053
#> vape2 -5.23363827 -0.44013515
#> alcohol1 -3.82464921 -1.05599542
#> alcohol2 -2.51857478 -0.06657700
#> drug1 -8.61093282 -2.86060333
#> drug2 -1.89529722 0.89779188
#> sleep1 -1.65943985 0.46027756
#> sleep2 -1.42526028 1.80139273
#> caffeine1 -1.25549974 1.19227726
#> caffeine2 -0.71189232 1.81186162
#> caffeine3 -6.48423583 1.02937729
#> stress2 -3.26245872 -0.57693306
#> stress3 -2.45871611 0.94560447
#> chem_expos1 -1.87258021 0.26972738
#> chem_expos2 -2.14045896 0.88728422
#> psych_med1 -1.25946562 1.41941451
#> relationship1 -1.28451399 2.59178288
#> relationship2 -1.39793666 1.10499033
#> place_living1 -0.99812484 0.91680394
#> place_living2 -4.78273854 -0.31551395
#> pregnancy1 -2.12635182 0.90751048
#> sexually_active1 -0.54449347 2.38304285
#> between_cycles1 -2.83820672 0.26819997
#> length_period1 2.52966590 6.02665954
#> mental_health1 -0.01271768 2.23225749
Created on 2022-12-31 by the reprex package (v2.0.1)