# Compraring two discrete (?) variables

I need to test if a baby's length is affected by the gestation period (in weeks). I started by testing the 2 variables for normality, but after getting conflicting results from the Shapiro-Wilk and Lilliefors tests (S-W p-value is 0.1316, Lilliefors p-value is 0.006419) for the gestation period, I looked at the qqplots, and realized these variables don't even seem to be continuous! I can understand why for the weeks, but how can length not be a continuous variable? Here are the qqplots:

I am not sure how to proceed from here. I don't think doing a regression analysis is right, but treating length as a categorical variable doesn't feel right, either. I am equally perplexed about the fact that other variables in my data, like the head circumference of the babies and the mothers' ages are also discrete. I have 100 observations. Here is my some of my data:

    data_struct <-
structure(
list(
27,
29,
30,
28,
29,
23,
22,
26,
27,
25,
23,
26,
27,
27,
26,
27,
26,
29,
28,
27,
25,
25,
24,
31,
28,
23,
26,
25,
23,
28,
35,
24,
33,
28,
26,
26,
26,
28,
29,
28,
27,
27,
28,
28,
22,
22,
28,
24,
28,
23,
22,
23,
28,
25,
27,
24,
23,
21,
25,
22,
27,
28,
26,
28,
27,
31,
30,
26,
27,
24,
25,
25,
29,
25,
29,
31,
29,
26,
23,
23,
25,
25,
28,
30,
26,
26,
29,
28,
27,
24,
29,
23,
28,
27,
26,
26,
27,
28,
28,
26
),
LENGTH = c(
41,
40,
38,
38,
38,
32,
33,
38,
30,
34,
32,
39,
38,
39,
37,
39,
38,
42,
39,
38,
36,
38,
34,
42,
37,
32,
36,
34,
33,
37,
36,
31,
39,
39,
37,
36,
37,
40,
43,
37,
36,
38,
39,
41,
32,
32,
40,
32,
40,
33,
31,
32,
39,
38,
35,
29,
20,
32,
35,
33,
38,
40,
35,
38,
39,
43,
38,
38,
38,
36,
39,
36,
41,
35,
41,
40,
39,
37,
31,
34,
37,
36,
40,
42,
38,
38,
42,
38,
36,
34,
38,
34,
41,
39,
38,
37,
40,
35,
41,
38
),
GESTAGE = c(
29,
31,
33,
31,
30,
25,
27,
29,
28,
29,
26,
30,
29,
29,
29,
29,
29,
33,
33,
29,
28,
30,
27,
33,
32,
28,
29,
28,
29,
30,
31,
30,
31,
29,
27,
27,
27,
32,
31,
28,
30,
29,
28,
31,
27,
25,
30,
28,
28,
25,
23,
27,
28,
27,
27,
26,
25,
23,
26,
24,
29,
29,
27,
30,
30,
32,
33,
27,
31,
26,
27,
27,
35,
28,
30,
31,
30,
27,
25,
25,
26,
29,
29,
34,
30,
29,
33,
30,
29,
24,
33,
25,
32,
31,
31,
31,
29,
32,
33,
28
)
),
class = "data.frame",
row.names = c(NA,-100L)
)

• That length (just as with heights of people) is normally binned should be obvious from the values it takes; it's rarely measured to greater accuracy than the nearest half cm, or quarter inch, and these data appear to be in whole cm. Aug 20, 2022 at 8:51

I see no issue that should be of any concern with modelling these data.

1. "discreteness"

All continuous data are binned/rounded/truncated.

That they're binned is not of itself a problem unless the bins are so broad that almost all of the data are in only a few bins (in which case we could treat them as interval censored). In this case I see no issue that would require that. You have lots of bins and only a small proportion of the distribution will fall into any one of them.

2. Normality.

You seem to be thinking about a regression model but it's important to be away that there's no assumption that either the x-variable (predictor, IV) nor the y-variable (response, DV) be normally distributed.

Which is to say that the test you did is irrelevant.

There's an assumption in the derivation of some tests and confidence intervals that relates to the normality of errors (equivalently, conditional normality of the response), but it's not something you can check by looking at the raw data and in any case is not likely to be consequential here -- in large samples the significance level of your test will be pretty robust to the conditional distribution, and quite insensitive to the sort of conditional distribution you will be dealing with.

Normality should not be causing you any angst. It wouldn't hurt to check a residuals - in some cases it might induce a little caution over conclusions - if you're so inclined, but there really won't be anything to bother yourself about here, you might do it to ease the mind of some readers, perhaps.

If you had a very particular concern, with a simple regression it would be possible to conduct a nonparametric test of the regression coefficient rather than one that assumed normality, but (as fond as I am of such things), it would be a waste of time here. There's simply no need for it, everything should be fine.

I don't find the discreteness perplexing at all. To the contrary, I am amazed nurses and doctors can even ascertain the length, weight and head circumference of a screaming, squirming newborn to the nearest inch or ounce. There is always some basic unit of measurement, so any measured quantity will be discrete.

More to the point, your data do not need to be non-discrete or normally distributed for regression to be valid: what matters is normality of parameter estimates, and this is asymptotically given under very mild conditions, and you certainly have enough data. (Normality of residuals is helpful.) See, e.g., https://stats.stackexchange.com/a/148812/1352. So go ahead and run your regression.