stability analysis using spike and slab package in R software - r
I tried to use the spikeslab pacakges on my data set. when i try to run a stability analysis (based on ishwaran & rao article)
i get an error that i couldn't find anything helpful about it on internet.
my code is :
y <- diabet[, 1]
x<- diabet[, -1]
cv.obj <- cv.spikeslab(x = x, y = y, K = 20 )
first an second lines run without any problem but running line 3 is where i get this error message :
"Error in svdwrapper(X) : svd(x) and svd(t(x)) both failed"
Please enlighten me about the cause and any possible way to resolve it.
structure(list(location = c(2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 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1L, 2L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L), age = c(37L, 37L, 39L, 32L, 34L, 28L, 25L, NA, 45L,
50L, 38L, NA, NA, 62L, NA, NA, NA, NA, NA, NA, 57L, 40L, 51L,
40L, 32L, 43L, 74L, 16L, 51L, 54L, 40L, 43L, 44L, 21L, 37L, 34L,
62L, 33L, 47L, 63L, 42L, 32L, 52L, 48L, 62L, 45L, 59L, 40L, 41L,
44L, 55L, 51L, 51L, 45L, 39L, 60L, 65L, 35L, 34L, 55L, 55L, 58L,
67L, 25L, 43L, 50L, 51L, 54L, 65L, 53L, 52L, 62L, 48L, 50L, 64L,
54L, 58L, 52L, 77L, 53L, 40L, 30L, 27L, 67L, 50L, 45L, 70L, 69L,
61L, 57L, 61L, 54L, 65L, 75L, 62L, 78L, 56L, 58L, 55L, 60L, 60L,
33L, 75L, 66L, 71L, 84L, 63L, 62L, 58L, 40L, 50L, 60L, 57L, 37L,
38L, 51L, 60L, 45L, 50L, 17L, 14L, 22L, 35L, 50L, 63L, 38L, 45L,
43L, 65L, 47L, 50L, 50L, 45L, 60L, 37L, 42L, 35L, 55L, 67L, 55L,
49L, 52L, 58L, 70L, 62L, 30L, 45L, 50L, 45L, 60L, 50L, 29L, 60L,
17L, 56L, 60L, 50L, 40L, 50L, 75L, 60L, 50L, 45L, 70L, 60L, 45L,
40L, 45L, 28L, 70L, 49L, 50L, 60L, 34L, 35L, 55L, 52L, 50L, 53L,
30L, 38L, 40L, 45L, 50L, 22L, 50L, 37L, 49L, 49L, 50L, 52L, 50L,
25L, 45L, 40L, 45L, 60L, 40L, 50L, 32L, 55L, 38L, 70L, 95L, 50L,
30L, 55L, 36L, 40L, 45L, 75L, 50L, NA, 70L, 32L, NA, 55L, 60L,
39L, 60L, 70L, 47L, 60L, 59L, 30L, 60L, 45L, 38L, 70L, 40L, 23L,
55L, 45L, 36L, 38L, 30L, 40L, 45L, 50L, 45L, 45L, 50L, 55L, 45L,
50L, 50L, 37L, 45L, 78L, 45L, 60L, 70L, 37L, 58L, 60L, 50L, 35L,
53L, 80L, 50L, 50L, 26L, 68L, 40L, 70L, 38L, 28L, 55L, 37L, 17L,
45L, 55L, 36L, 48L, 60L, 40L, 55L, 65L, 60L, 66L, 53L, 69L, 55L,
29L, 21L, 26L, 27L, 45L, 49L, 47L, 31L, 50L, 14L, 50L, 48L, 60L,
49L, 55L, 70L, 22L, 70L, 36L, 60L, 45L, 42L, 60L, 30L, 50L, 55L,
45L, 55L, 90L, 23L, 58L, 50L, 26L, 14L, 56L, 30L, 50L, 50L, 56L,
60L, 32L, 52L, 40L, 36L, 61L, 19L, 28L, 32L, 51L, 21L, 50L, 44L,
46L, 83L, 36L, 30L, 32L, 55L, 73L, 31L, 34L, 35L, 55L, 45L, 13L,
37L, 45L, 25L, 21L, 26L, 60L, 45L, 50L, 22L, 51L, 80L, 43L, 80L,
37L, 50L, 49L, 61L, 78L, 24L, 37L, 50L, 29L, 28L, 45L, 66L, 46L,
58L, 84L, 31L, 70L, 22L, 27L, 35L, 81L, 34L, 17L, 29L, 28L, 21L,
31L, 33L, 34L, 60L, 48L, 75L, 52L, 38L, 46L, 41L, 62L, 45L, 73L,
43L, 53L, 44L, 31L, 52L, 28L, 53L, 50L, 70L, 44L, 40L, 56L, 54L,
43L, 28L, 75L, 70L, 37L, 40L, 42L, 19L, 39L, 70L, 59L, 33L, 29L,
25L, 35L, 48L, 44L, 36L, 31L, 35L, 35L, NA, 26L, 32L, 42L, 23L,
25L, 48L, 40L, 45L, 34L, 57L, 29L, 53L, 27L, 17L, 21L, 57L, 24L,
31L, 31L, 38L, 38L, 71L, 42L, 28L, 50L, 50L, 51L, 44L, 52L, 59L,
63L, 40L, 20L, 56L, 45L, 65L, 60L, 37L, 70L, 34L, 55L, 63L, 43L,
77L, 42L, 45L, 63L, 55L, 32L, 28L, 27L, 63L, 80L, 60L, 58L, 53L,
42L, 43L, 43L, 56L, 28L, 31L, 29L, 59L, 33L), height1 = c(170L,
147L, 160L, NA, 164L, 174L, 172L, 157L, 98L, 163L, 165L, 165L,
175L, 171L, 175L, NA, 165L, 165L, 176L, 176L, 161L, 156L, 176L,
165L, 165L, 175L, 162L, 155L, 165L, 160L, 175L, 184L, 174L, 166L,
150L, 190L, 170L, 169L, 162L, 161L, 181L, 178L, 169L, 165L, 171L,
165L, 162L, 172L, 170L, 170L, 165L, 163L, 175L, 167L, 165L, 179L,
160L, 168L, 161L, 162L, 173L, 165L, 175L, 175L, 160L, 170L, 178L,
170L, 171L, 170L, NA, 165L, NA, 165L, NA, 16L, 160L, 165L, 180L,
176L, 165L, NA, NA, 180L, 170L, 170L, 170L, 115L, 165L, 165L,
164L, 177L, 165L, 165L, 170L, 165L, 187L, NA, 185L, 175L, 160L,
169L, 170L, 170L, NA, 176L, 170L, NA, 170L, 152L, 148L, 169L,
170L, 187L, 159L, 161L, 151L, 159L, 154L, 160L, 149L, 152L, 158L,
155L, 163L, 168L, 163L, 162L, 151L, 167L, 154L, 150L, 151L, 155L,
159L, 160L, 153L, 160L, 141L, 161L, 146L, 159L, 149L, 150L, 145L,
162L, 179L, 152L, 151L, 152L, 150L, 153L, 152L, 156L, 153L, 151L,
159L, 160L, 165L, 160L, 155L, 148L, 159L, 159L, 159L, 158L, 156L,
153L, 188L, 157L, 158L, 152L, 157L, 154L, 159L, 148L, 161L, 153L,
146L, 175L, 156L, 153L, 149L, 153L, 162L, 158L, 159L, 159L, 158L,
146L, 185L, 156L, 155L, 148L, 158L, 146L, 153L, 154L, 147L, 156L,
149L, 174L, 158L, 151L, 150L, 157L, 145L, 151L, 162L, 157L, 155L,
153L, 171L, 142L, 161L, 152L, 154L, 157L, 153L, 153L, 149L, 164L,
145L, 162L, 180L, 152L, 162L, 162L, 150L, 149L, 153L, 151L, 155L,
168L, 160L, 173L, 155L, 155L, 160L, 151L, 146L, 159L, 162L, 148L,
158L, 157L, 167L, 152L, 151L, 156L, 156L, 152L, 158L, 156L, 168L,
147L, 158L, 158L, 160L, 152L, 152L, 164L, 165L, 159L, 154L, 154L,
145L, 164L, 163L, 152L, 156L, 159L, 155L, NA, 156L, 162L, 160L,
154L, 152L, 163L, 154L, 165L, 153L, 152L, 146L, 157L, 156L, 164L,
154L, 152L, 170L, 160L, 144L, 160L, 155L, 150L, 154L, 158L, 148L,
155L, 150L, 179L, 156L, 164L, 152L, 151L, 161L, 160L, 160L, 155L,
149L, 158L, 158L, 158L, 160L, 163L, 160L, 157L, 151L, 162L, 158L,
152L, 155L, 166L, 159L, 160L, 158L, 150L, 158L, 158L, 154L, 152L,
160L, 156L, 157L, 185L, 146L, 169L, 79L, 174L, 150L, 175L, 155L,
163L, 155L, 153L, 190L, 135L, 159L, 158L, 164L, 153L, 157L, 150L,
160L, 174L, 154L, 172L, 167L, 175L, 155L, 164L, 163L, 155L, 164L,
144L, 161L, 178L, NA, 176L, 174L, 173L, 169L, 181L, 160L, 160L,
145L, 165L, NA, 156L, NA, 171L, 157L, 140L, 160L, 150L, 170L,
NA, 178L, 180L, 170L, NA, 167L, 175L, 171L, 187L, 178L, 170L,
157L, 170L, 146L, 170L, 170L, 152L, 163L, 158L, 162L, 161L, NA,
150L, 151L, 147L, 173L, 168L, 151L, 164L, 165L, 153L, 155L, 162L,
169L, 150L, 144L, 168L, 152L, 164L, 183L, 161L, 170L, 157L, 155L,
178L, 170L, 162L, 168L, 154L, 175L, 175L, 160L, 168L, 168L, 186L,
150L, NA, 150L, 158L, 170L, 182L, 151L, 162L, 152L, 154L, 151L,
160L, 154L, 154L, 160L, 155L, 170L, 160L, 154L, 180L, 173L, 177L,
182L, 155L, 168L, 178L, 165L, 178L, 162L, 188L, 172L, 171L, 185L,
185L, 172L, 175L, 157L, 165L, NA, 167L, 165L, 161L, 152L, 159L,
175L, 176L, 164L, 175L, 168L, NA, 170L, 172L, 186L, 176L, 172L,
181L, 182L, 165L), weight = c(120, 66, 72, NA, 84, 90, 72, 58,
65, 80, 65, 115, 76, 84, 70, NA, 65, 76.5, 90, 80, 88, 50, 85,
75, 68, 75, 85, 55, 73, 90, 82, 85, 83, 73, 58, 89, 75, 71, 75,
65, 92, 82, 65, 75, 70, 82, 80, 68, 61, 100, 89, 85, 70, 87,
68, 80, 67, 63, 63, 62, 53, 65, 68, 93, 74, 82, 91, 65, 74, 73,
50, 105, NA, 70, NA, 63, 55, 84, 82, 89, 49, NA, NA, 73, 95,
50, 52, 60, 75, 60, 70, 65, 52, 60, 50, 72, 95, 90, 85, 78, 50,
93, 60, 60, 82, 70, 59, NA, 65, 85, 58, 68, 71, 98, 80, 69, 64,
58, 59, 61, 45, 40, 57, 70, 63, 65.5, 65, 66, 63, 71, 69, 65,
71, 66, 81, 52, 75, 73, 52, 64, 71, 65, 72, 66, 74, 76, 72, 74,
52, 59, 68, 66, 59, 38, 64, 60, 72, 47, 72, 35, 75, 56, 72, 65,
68, 82, 66, 76, 83, 68, 69, 66, 69, 74, 81, 70, 78, 56, 55, 95,
95, 68, 70, 67, 70, 70, 69, 75, 70, 70, 71, 62, 60, 69, 95, 59,
75, 91, 62, 79, 65, 90, 69, 55, 70, 55, 65, 55, 76, 76, 55, 74,
65, 45, 45, 50, 63, 49, 71, 60, 60, 53, 51, 65, 72, 65, 74, 58,
65, 71, 65, 88, 45, 89, 41, 61, 60, 68, 67, 69, 54, 73, 51, 59.9,
89, 45, 60, 48, 49.5, 46.5, 57, 68, 66, 92, 68, 43, 63, 85, 53,
53, 38, 66, 67, 59, 66, 54, 72, 66.4, 79, 44, 74, 84, 68, 73,
73, 57.4, 44, 64, 62, 74, 62.6, 74, 46, 68, 55, 67, 55, 74.5,
65, 61.5, 53, 80, 27, 54, 84, 37.5, 58.1, 54, 70, 63, 61, 85,
79, 70.8, 54, 68, 80.8, 62, 67, 55, 93, 54, 80, 67.8, 75.3, 84,
47, NA, 50, 65, 50, 49, NA, 65, 52, 58, 58, 59, 46, 73, 60, 59,
51, 57, 76.5, 76, 38, 78, 159, 82, 78, 77, 56, 83.2, 85, 104,
80, 39, 86, 73, 64, 51, 62, 54, 61, 63, 48, 81, 42, 75.5, 49,
67, 90, 60, 59, 55, 54, 99, NA, 110, 58, 70, 60, 93, 60.5, 64.5,
55, 51, 58, 63, NA, 72, 74, 48, 79, 54.5, 66, NA, 75, 89, 89,
78, 70.5, 76, 77, 99.5, 82, 99, 54, 59, 55, 85, 73, 70, 63, 75,
68, 66.5, NA, 85, 77, 78, 68, 83, 65, 55, 80, 71, 96, 89, 57,
90, 59, 67, 59, 60, 62, 70, 79, 72, 64, 65, 60, 71, 70, 57, 79,
91, 50, 74.5, 66, 91, 44, NA, 50, 53, 68, 95, 51, 78, 57.5, 40,
70.5, 60, 74, 70, 82, 90, 94, 72, 57.5, 91, 86, 68, 77, 51, 83,
73, 76, 68, 65, 91, 77, 965, 99, 96, 80, 82, 57, 82, NA, 60,
69, 67, 65, 57, 63, 60, 68, 62, 64, NA, 95, 60, 77, 104, 76,
83, 80, 74), BMI = c(38, 30, 28, NA, 31, 30, 24, 24, NA, 30,
24, 42, 25, 28, 23, NA, 24, 28, 29, 26, 34, 21, 27, 28, 24, 24,
32, 23, 27, 35, 27, 25, 27, 26, 26, 24, 26, 25, 29, 25, 28, 26,
23, 28, 24, 30, 30, 23, 22, 35, 33, 32, 23, 31, 25, 25, 26, 22,
25, 24, 18, 24, 22, 30, 29, 28, 29, 22, 24, 25, NA, 39, NA, 26,
NA, 25, 21, 31, 25, 23, 18, NA, NA, 23, 33, 17, 18, 45, 26, 22,
26, 21, 19, 22, 17, 26, 27, NA, 25, 25, 20, 32, 21, 21, NA, 23,
24, NA, 22, 26, 26, 23, 24, 28, 31, 26, 28, 22, 22, 23, 20, 17,
22, 29, 23, 23, 24, 35, 27, 25, 29, 28, 31, 27, 31, 21, 32, 28,
26, 24, 30, 25, 32, 29, 35, 29, 22, 32, NA, 25, 30, 28, 24, 16,
27, 26, 28, 18, 26, 14, 31, 25, 28, 25, 26, 32, 27, 32, 24, 27,
27, 28, 25, 31, 32, 31, 30, 23, 23, 30, 39, 29, 31, 28, 26, 28,
27, 30, 28, 30, 21, 25, 25, 31, 38, 25, 32, 38, 28, 32, 28, 30,
27, 24, 31, 22, 31, 24, 28, 30, 22, 31, 22, 22, 17, 21, 26, 19,
30, 25, 27, 19, 24, 24, 22, 28, 28, 22, 28, 31, 27, 38, 18, 31,
18, 20, 25, 28, 26, 30, 25, 29, 19, 27, 36, 18, 21, 21, 22, 19,
23, 29, 26, 38, 24, 20, 25, 33, 21, 23, 16, 25, 25, 23, 28, 23,
26, 25, 30, 19, 30, 33, 28, NA, 30, 22, 17, 27, 27, 28, 26, 27,
20, 29, 20, 27, 20, 25, 27, 27, 18.5, 31, 12, 21, 35, 17, 24,
22, 32, 26, 27, 27, 32, 26, 23, 30, 31, 24, 26, 23, 43, 22, 33,
27, 29, 32, 18, NA, 22, 25, 20, 21, NA, 24, 21, 23, 23, 26, 18,
29, 25, 26, 20, 23, 31, 21, 18, 27, 31, 27, 35, 25, 23, 31, 35,
44, 22, 21, 15, 29, 24, 22, 25, 24, 24, 21, 20, 27, 15, 25, 20,
25, 34, 25, 22, 27, 21, 31, NA, 36, 19, 23, 21, 28, 24, 25, 26,
NA, NA, 29, NA, 25, 30, 24, 31, 24, 23, NA, 24, 27, 31, NA, 25,
25, 26, 28, 26, 34, 22, 20, 26, 29, 25, 30, 24, 30, 26, 26, NA,
38, 34, 36, 23, 29, 29, 20, 29, 30, 40, 34, 20, 44, 27, 24, 26,
NA, 19, 22, 27, 29, 27, 21, 21, 13, 25, 24, 26, 30, 20, 27, 23,
26, 20, NA, 22, 21, 24, 29, 23, 30, 25, 17, 31, 23, 31, 30, 32,
30, 33, 28, 24, 28, 29, 22, 23, 22, 29, 23, 28, 21, 24, 26, 26,
22, 29, 28, 27, 27, 23, 30, NA, 22, 25, 26, 21, 23, 21, 19, 25,
20, 23, NA, 33, 20, 22, 34, 26, 25, 24, 27), f.sistol = c(150L,
130L, 110L, 120L, 110L, 110L, 130L, 120L, 100L, 100L, 110L, 140L,
140L, 100L, 120L, 150L, 110L, 120L, 120L, 120L, 120L, 120L, 180L,
110L, 100L, 120L, 120L, 100L, 130L, 130L, 120L, 150L, 120L, 110L,
130L, 110L, 110L, 130L, 120L, 160L, 140L, 150L, 16L, 120L, 120L,
120L, 11L, 130L, 120L, 90L, 120L, 190L, 140L, 120L, 120L, 150L,
150L, 100L, 140L, 120L, 100L, 120L, 150L, 120L, 170L, 110L, 160L,
120L, 120L, 100L, 120L, 140L, 90L, 120L, 170L, 100L, 120L, 110L,
140L, 120L, 165L, 90L, 100L, 140L, 150L, 160L, 140L, 140L, 180L,
100L, 120L, 150L, 120L, 100L, 100L, 150L, 100L, 140L, 120L, 140L,
140L, 100L, 120L, 140L, 150L, 110L, 100L, 120L, 120L, 130L, 170L,
70L, 130L, 120L, 80L, 110L, 110L, 90L, 100L, 100L, 70L, 80L,
100L, 120L, 120L, 90L, 90L, 110L, 110L, 100L, 180L, 130L, 90L,
160L, 90L, 110L, 140L, 130L, 80L, 100L, 90L, 100L, 100L, 110L,
80L, 80L, 110L, 110L, 90L, 120L, 80L, 120L, 100L, 60L, 130L,
110L, 110L, 110L, 80L, 130L, 120L, 120L, 120L, 120L, 110L, 120L,
110L, 100L, 100L, 100L, 140L, 120L, 120L, 100L, 140L, 110L, 110L,
110L, 110L, 100L, 100L, 120L, 110L, 100L, 100L, 120L, 100L, 100L,
100L, 140L, 100L, 100L, 110L, 120L, 120L, 90L, 130L, 110L, 100L,
100L, 110L, 100L, 100L, 120L, 110L, 90L, 120L, 110L, 130L, 90L,
100L, 130L, 100L, 140L, 110L, 110L, 120L, 90L, 90L, 120L, 100L,
110L, 120L, 110L, 110L, 150L, 140L, 110L, 90L, 110L, 80L, 130L,
100L, 110L, 80L, 110L, 90L, 110L, 110L, 110L, 100L, 110L, 120L,
90L, 130L, 110L, 120L, 90L, 130L, 100L, 100L, 140L, 130L, 140L,
100L, 100L, 90L, 120L, 110L, 130L, 90L, 90L, 120L, 90L, 100L,
80L, NA, 100L, 110L, 100L, 90L, 90L, 90L, 100L, 130L, 100L, 90L,
100L, 140L, 100L, 100L, 100L, 100L, 110L, 100L, 100L, 120L, 12L,
100L, 140L, 100L, 100L, 100L, 90L, 90L, 80L, 80L, 100L, 90L,
100L, 90L, 110L, 80L, 90L, 90L, 100L, 110L, 110L, 120L, 130L,
100L, 110L, 110L, 140L, 90L, 100L, 90L, 100L, 70L, 80L, 80L,
80L, 120L, 110L, 90L, 120L, 110L, 140L, 90L, 110L, 110L, 100L,
100L, 100L, 110L, 120L, 90L, 110L, 90L, 90L, 100L, 120L, 110L,
90L, 90L, 110L, 110L, 110L, 110L, 110L, 100L, 90L, 90L, 130L,
90L, 140L, 110L, 110L, 135L, 115L, 130L, 110L, 110L, 130L, 185L,
135L, 110L, 120L, 100L, 130L, 110L, 130L, 120L, 130L, 110L, 135L,
110L, 120L, 100L, 100L, 110L, 140L, 100L, 90L, 100L, 90L, 90L,
120L, 100L, 130L, 16L, 100L, 120L, 165L, 145L, 135L, 120L, 150L,
100L, 110L, 100L, 130L, 100L, 110L, 110L, 110L, 130L, 110L, 140L,
130L, 100L, 100L, 120L, 120L, 100L, 13L, 120L, 110L, 120L, 100L,
100L, 120L, 140L, 120L, 100L, 100L, 120L, 110L, 100L, 100L, 110L,
125L, 110L, 130L, 90L, 110L, 125L, 120L, 110L, 135L, 125L, 125L,
110L, 100L, 110L, 90L, 100L, 120L, 100L, 100L, 90L, 100L, 100L,
100L, 110L, 110L, 110L, 130L, 110L, 110L, 80L, 140L, 100L, NA,
140L, 140L, 140L, 140L, 140L, 100L, 145L, 165L, 140L, 155L, 145L,
210L, 180L, 150L, 175L, 175L, 100L, 145L, 140L, 110L, 110L, 100L,
140L, 155L, 180L, 150L, 130L, 100L, 130L, 110L, 130L, 105L, 130L,
125L, 150L, 115L), f.diastol = c(90, 70, 60, 70, 70, 80, 80,
70, 70, 80, 80, 90, 20, 70, 80, 90, 80, 80, 80, 80, 80, 80, 80,
70, 60, 80, 80, 80, 80, 80, 80, 90, 80, 80, 90, 70, 70, 80, 80,
10, 90, 90, 90, 80, 80, 80, 70, 90, 80, 80, 80, 80, 90, 90, 80,
80, 50, 70, 80, 80, 80, 80, 90, 80, 80, 70, 80, 80, 90, 70, 80,
70, 60, 80, 90, 60, 80, 80, 80, 70, 49, 70, 70, 80, 90, 60, 60,
60, 80, 60, 70, 90, 70, 60, 70, 80, 60, 80, 70, 70, 70, 70, 80,
90, 80, 80, 70, 70, 80, 60, 80, 60, 70, 60, 60, 80, 80, 60, 60,
80, 60, 60, 60, 80, 70, 80, 60, 80, 60, 70, 80, 70, 80, 80, 60,
60, 80, 80, 50, 80, 80, 80, 80, 80, 60, 60, 60, 80, 80, 80, 60,
80, 80, 80, 100, 60, 60, 70, 60, 60, 80, 80, 80, 60, 90, 60,
60, 60, 60, 50, 80, 50, 80, 80, 80, 40, 80, 60, 90, 70, 60, 60,
90, 60, 60, 80, 80, 60, 80, 80, 70, 60, 80, 80, 80, 60, 80, 60,
90, 50, 50, 70, 60, 80, 80, 60, 60, 60, 60, 60, 80, 10, 70, 60,
60, 61, 60, 20, 80, 80, 80, 70, 60, 60, 60, 40, 80, 90, 60, 60,
60, 80, 80, 60, 60, 60, 60, 60, 60, 60, 40, 60, 60, 60, 80, 60,
60, 60, 80, 80, 80, 80, 60, 70, 60, 80, 60, 60, 60, 80, 60, 60,
80, 60, 60, 60, NA, 60, 70, 60, 60, 60, 60, 60, 60, 40, 60, 60,
80, 70, 60, 60, 60, 80, 60, 60, 60, 80, 60, 80, 60, 60, 60, 60,
60, 60, 60, 60, 40, 70, 60, 70, 60, 60, 60, 60, 70, 60, 80, 80,
60, 70, 70, 80, 60, 60, 60, 60, 40, 60, 60, 60, 60, 80, 60, 80,
60, 80, 60, 80, 80, 70, 80, 60, 70, 80, 60, 80, 60, 60, 60, 80,
70, 60, 60, 80, 70, 80, 80, 80, 70, 60, 50, 70, 60, 80, 80, 70,
80, 75, 80, 75, 80, 80, 100, 80, 70, 80, 60, 80, 70, 70, 75,
85, 70, 80, 70, 75, 80, 80, 80, 60, 60, 60, 80, 60, 60, 90, 80,
70, 80, 80, 75, 85, 85, 85, 80, 95, 70, 70, 70, 80, 80, 80, 70,
70, 70, 70, 90, 80, 70, 70, 80, 80, 70, 80, 80, 70, 80, 70, 70,
70, 70, 80, 70, 70, 80, 70, 80, 80, 70, 75, 70, 75, 60, 80, 75,
80, 60, 85, 75, 85, 90, 90, 80, 60, 50, 80, 60, 80, 60, 60, 80,
80, 70, 70, 70, 80, 70, 70, 60, 85, 80, NA, 90, 90, 90, 95, 90,
80, 95, 100, 90, 80, 90, 120, 95, 90, 90, 90, 80, 90, 90, 65,
75, 70, 90, 90, 10, 90, 75, 80, 85, 70, 85, 75, 80, 80, 85, 75
), sabeghe.feshar = c(1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L,
2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, NA, 2L, NA, 2L, NA,
2L, 2L, 2L, NA, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L,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, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L,
1L, 1L, 2L), BS = c(115L, 129L, NA, 87L, 78L, 109L, 87L, 123L,
98L, 118L, 81L, 99L, 96L, NA, 99L, 96L, 96L, 96L, 89L, 385L,
85L, NA, 73L, 129L, NA, 130L, 118L, 158L, 217L, 118L, 117L, 95L,
107L, 126L, 139L, 70L, 317L, 123L, 166L, 58L, 177L, 127L, 91L,
313L, 117L, 123L, 112L, 122L, 133L, 153L, 138L, 165L, NA, 224L,
118L, 340L, 120L, NA, 125L, 130L, 110L, 98L, NA, NA, 128L, 80L,
170L, 251L, 89L, 134L, 84L, 80L, 108L, 173L, 107L, 107L, 138L,
140L, 350L, 144L, NA, NA, 109L, NA, 110L, 123L, 235L, 115L, NA,
125L, NA, 177L, 150L, NA, 114L, 208L, 122L, 278L, 110L, 128L,
NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 122L, 123L, 154L, NA,
125L, 126L, 133L, 130L, 130L, 126L, 86L, 53L, 354L, 90L, NA,
120L, 182L, 77L, 156L, 120L, 126L, 110L, 100L, 154L, 211L, NA,
117L, 102L, 113L, 123L, 130L, 109L, 99L, 292L, 113L, 117L, NA,
136L, 99L, 143L, 99L, 97L, 164L, 101L, 115L, 89L, 89L, NA, 120L,
120L, 158L, 93L, 118L, 125L, 131L, 120L, 121L, 164L, NA, 121L,
121L, 141L, 114L, 116L, 120L, 132L, 140L, 100L, 130L, 123L, 118L,
251L, 126L, 144L, 103L, 105L, 113L, 74L, 162L, 91L, NA, 152L,
11L, 115L, 152L, 142L, 152L, 116L, 110L, 118L, 110L, NA, 110L,
124L, 98L, 71L, 123L, 118L, 106L, 112L, 416L, 109L, NA, 117L,
92L, 114L, 56L, 99L, 106L, 130L, 130L, 94L, 114L, 282L, 96L,
120L, 111L, 115L, 118L, 116L, 99L, 156L, 111L, 128L, 90L, NA,
66L, 109L, 138L, 296L, 238L, 226L, 326L, 490L, 77L, 86L, NA,
117L, 149L, 94L, 102L, 117L, 112L, 176L, 168L, 122L, 97L, 110L,
114L, 94L, 93L, 103L, 100L, 73L, 172L, 91L, 102L, 103L, NA, 100L,
119L, 123L, 87L, 113L, 153L, 109L, 143L, 107L, 104L, NA, 103L,
112L, 106L, 102L, 102L, 103L, 102L, 87L, 111L, 99L, NA, 139L,
100L, 106L, 109L, 186L, 83L, 102L, 107L, 82L, 99L, NA, 183L,
107L, 49L, 218L, 116L, 122L, 104L, 114L, 106L, 81L, 96L, 131L,
88L, 101L, 93L, 88L, 140L, 130L, 86L, 99L, 103L, 111L, 111L,
125L, 104L, 106L, 94L, 91L, 104L, 94L, 84L, 103L, 378L, 193L,
143L, 93L, 90L, 100L, 111L, 134L, 84L, 128L, 105L, 162L, NA,
97L, 148L, 180L, 109L, 105L, 133L, 145L, 134L, 152L, 96L, 111L,
141L, 121L, 87L, 100L, 357L, 215L, 111L, 184L, 108L, 120L, 164L,
113L, 83L, 150L, 141L, 106L, 99L, 111L, 107L, 116L, 101L, 101L,
117L, 170L, 92L, 97L, 94L, 83L, 97L, 81L, 102L, 106L, 109L, 87L,
323L, 134L, 106L, 93L, 202L, 118L, 116L, 169L, 267L, 203L, NA,
NA, 143L, NA, 295L, 126L, 184L, 180L, NA, NA, 510L, 106L, 53L,
206L, 104L, 73L, 145L, 111L, NA, NA, NA, 128L, 110L, 97L, NA,
NA, 135L, 115L, 140L, 137L, 117L, 167L, 122L, 100L, 125L, 98L,
90L, 107L, 134L, 94L, 96L, 128L, 104L, 87L, 351L, 94L, 104L,
95L, 113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L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, NA, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, NA, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L)),
Related
Identify function is not accurate in R
Here is the problem: When I use cook's distance to check influential points in SLR, I used two methods. First one: plot(mortality.model, which = 4) This one gives me the correct answer. Second one: plot(cooks.distance(mortality.model), type = 'p') identify(cooks.distance(mortality.model)) This one gives me the wrong answer, but very close to the correct answer. Read the data set: df.mortality <- read.csv("mortality.csv", header = TRUE) Build the model: mortality.model <- lm(log(infant) ~ log(income)) By the way, the dataset has NA values. If you would like to see the dataset, I could email it to you. The dput result: structure(list(X = structure(c(4L, 5L, 7L, 15L, 23L, 29L, 30L, 101L, 41L,43L, 46L, 61L, 62L, 66L, 73L, 79L, 86L, 87L, 10L, 97L, 2L, 25L, 38L, 39L, 40L, 52L, 65L, 75L, 100L, 3L, 9L, 18L, 19L, 21L, 24L, 32L, 33L, 42L, 45L, 50L, 55L, 58L, 63L, 68L, 71L, 77L, 83L, 89L, 93L, 94L, 99L, 103L, 105L, 8L, 14L, 20L, 26L, 27L, 31L, 36L, 44L, 47L, 80L, 51L, 59L, 69L, 70L, 72L, 88L, 91L, 95L, 81L, 1L, 6L,11L, 12L, 13L, 16L, 17L, 22L, 28L, 34L, 35L, 37L, 48L, 49L, 53L, 54L, 56L, 57L, 60L, 64L, 67L, 74L, 76L, 78L, 84L, 85L, 90L, 92L, 96L, 98L, 82L, 102L, 104L), .Label = c("Afganistan", "Algeria", "Argentina", "Australia", "Austria", "Bangladesh","Belgium", "Bolivia", "Brazil", "Britain", "Burma","Burundi","Cambodia","Cameroon", "Canada", "Central.African.Republic", "Chad","Chile", "Colombia","Congo", "Costa.Rica", "Dahomey", "Denmark", "Dominican.Republic", "Ecuador", "Egypt", "El.Salvador", "Ethiopia", "Finland", "France", "Ghana", "Greece", "Guatemala", "Guinea", "Haiti", "Honduras", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Ivory.Coast", "Jamaica", "Japan", "Jordan", "Kenya", "Laos", "Lebanon", "Liberia", "Libya", "Madagascar", "Malawi", "Malaysia", "Mali", "Mauritania", "Mexico", "Moroco", "Nepal", "Netherlands", "New.Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Pakistan", "Panama", "Papua.New.Guinea", "Paraguay", "Peru", "Philippines", "Portugal", "Rwanda", "Saudi.Arabia", "Sierra.Leone", "Singapore", "Somalia", "South.Africa", "South.Korea", "South.Vietnam", "Southern.Yemen", "Spain", "Sri.Lanka", "Sudan", "Sweden", "Switzerland", "Syria", "Taiwan", "Tanzania", "Thailand", "Togo", "Trinidad.and.Tobago", "Tunisia", "Turkey", "Uganda", "United.States", "Upper.Volta", "Uruguay", "Venezuela", "West.Germany", "Yemen", "Yugoslavia", "Zaire", "Zambia"), class = "factor"), income = c(3426L, 3350L, 3346L, 4751L, 5029L, 3312L, 3403L, 5040L, 2009L, 2298L, 3292L, 4103L, 3723L, 4102L, 956L, 1000L, 5596L, 2963L, 2503L, 5523L, 400L, 250L, 110L, 1280L, 560L, 3010L, 220L, 1530L, 1240L, 1191L, 425L, 590L, 426L, 725L, 406L, 1760L, 302L, 2526L, 727L, 631L, 295L, 684L, 507L, 754L, 335L, 1268L, 1256L, 261L, 732L, 434L, 799L, 406L, 310L, 200L, 100L, 281L, 210L, 319L, 217L, 284L, 387L, 334L, 344L, 197L, 279L, 477L, 347L, 230L, 334L, 210L, 435L, 130L, 75L, 100L, 73L, 68L, 123L, 122L, 70L, 81L, 79L, 79L, 100L, 93L, 169L, 71L, 120L, 130L, 50L, 174L, 90L, 70L, 102L, 61L, 148L, 85L, 162L, 125L, 120L, 160L, 134L, 82L, 96L, 77L, 118L), infant = c(26.7, 23.7, 17, 16.8, 13.5, 10.1, 12.9, 20.4, 17.8, 25.7, 11.7, 11.6, 16.2, 11.3, 44.8, 71.5, 9.6, 12.8, 17.5, 17.6, 86.3, 78.5, 125, NA, 28.1, 300, 58, 650, 51.7, 59.6, 170, 78, 62.8, 54.4, 48.8, 27.8, 79.1, 22.1, 26.2, 13.6, 32, 60.9, 46, 34.1, 65.1, 20.4, 15.1, 19.1, 26.2, 76.3, 40.4, 43.3, 259, 60.4, 137, 180, 114, 58.2, 63.7, 39.3, 138, 21.3, 58, 159.2, 149, 10.2, 38.6, 67.9, 21.7, 27, 153, 100, 400, 124.3, 200, 150, 100, 190, 160, 109.6, 84.2, 216, NA, 60.6, 55, NA, 102, 148.3, 120, 187, NA, 200, 124.3, 132.9, 170, 158, 45.1, 129.4, 162.5, 127, 160, 180, 80, 50, 104), region = structure(c(3L, 4L, 4L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 3L, 4L, 4L, 1L, 4L, 4L, 4L, 2L, 1L, 2L, 3L, 3L, 3L, 1L, 1L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 2L, 3L, 2L, 3L, 3L, 2L, 2L, 2L, 2L, 3L, 4L, 3L, 2L, 1L, 2L, 4L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 3L, 3L, 1L, 1L, 3L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 2L, 3L, 1L, 3L, 1L, 1L, 1L, 1L, 3L, 1L, 3L, 1L, 1L, 1L, 3L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 1L), .Label = c("Africa", "Americas", "Asia", "Europe"), class = "factor"), oil = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("no", "yes"), class = "factor")), class = "data.frame", row.names = c(NA, -105L)) Thanks! Here are results:The correct answer The wrong answer Could anyone explain why it happened?
Why are the fitted values from this linear model not continuous?
I would like to estimate the length of individuals based on their age and sex, using OLS in R. To that purpose I built the following model: m1 <- lm(length ~ age + sex, data = data.frame). Next, I created some simple residual plots by running: op <- par(mfrow = c(2,2)) plot(resid(m1) ~ fitted(m1)) plot(resid(m1) ~ data.frame$age) plot(resid(m1) ~ data.frame$sex) qqnorm(resid(m1)); qqline(resid(m1)) par(op) yielding this plot: Strange enough, the fitted values do not seem to have the range [165,180], but rather [165,170] ∪ [175,180] (top left plot). I do not understand why this is happening. Below some sample data producing the plots above: structure(list(length = c(173, 170, 172, 160, 162.5, 180, 179.5, 175, 168, 186.5, 163.5, 170.5, 160, 175.5, 186.5, 176.5, 168, 180.5, 179, 167, 183, 188.5, 176, 165, 170, 171, 176, 172, 187, 189, 180, 175.5, 162.5, 187, 164, 177, 170.5, 159.5, 161.5, 167, 178, 180.5, 168.5, 162, 171, 173, 171.5, 174.5, 177, 158, 175, 170, 183.5, 166, 174.5, 174, 176, 165, 163.5, 171.5, 161, 173, 165, 186, 171, 164.5, 182.5, 156.5, 156, 175, 168.5, 195, 164, 167.5, 168, 165.5, 172.5, 167, 175, 190, 170.5, 166, 155, 179.5, 175, 185, 174, 158.5, 172.5, 172.5, 173, 177, 161.5, 173.5, 159, 181, 176, 181.5, 167.5, 170.5), age = c(31.0965092402464, 67.7481177275838, 60.9062286105407, 54.776180698152, 57.8316221765914, 42.0287474332649, 47.1786447638604, 51.315537303217, 68.0876112251882, 32.3613963039014, 52.1259411362081, 50.7652292950034, 53.6947296372348, 64.6242299794661, 66.9733059548255, 66.8829568788501, 63.668720054757, 73.533196440794, 57.7659137577002, 43.7262149212868, 51.2416153319644, 30.7953456536619, 73.0403832991102, 52.2984257357974, 46.2614647501711, 35.7618069815195, 74.0670773442847, 35.6878850102669, 43.3894592744695, 65.0458590006845, 55.9671457905544, 71.2306639288159, 58.5653661875428, 40.0520191649555, 39.9698836413415, 44.0109514031485, 34.4722792607803, 47.5400410677618, 51.8822724161533, 46.9596167008898, 39.0143737166324, 49.0349075975359, 39.3812457221081, 48.2518822724162, 37.0376454483231, 30.425735797399, 31.5838466803559, 74.9459274469541, 46.3353867214237, 56.0602327173169, 54.4476386036961, 58.4120465434634, 47.64681724846, 39.047227926078, 45.2183436002738, 48.0246406570842, 41.5140314852841, 61.0732375085558, 52.2600958247776, 62.9760438056126, 70.715947980835, 70.5735797399042, 40.2436687200548, 35.0198494182067, 41.1772758384668, 57.2210814510609, 64.2710472279261, 59.6221765913758, 63.0088980150582, 48.5366187542779, 30.0369609856263, 48.8898015058179, 49.7741273100616, 54.7624914442163, 61.284052019165, 37.0102669404517, 58.4695414099932, 55.3483915126626, 39.4579055441478, 49.3333333333333, 37.9712525667351, 57.388090349076, 70.8199863107461, 37.0212183436003, 51.3675564681725, 48.3860369609856, 35.895961670089, 39.5208761122519, 37.4209445585216, 46.8692676249144, 65.3826146475017, 51.9425051334702, 33.2594113620808, 55.1156741957563, 33.9493497604381, 33.2895277207392, 42.0369609856263, 29.4976043805613, 54.9514031485284, 36.2327173169062), sex = structure(c(1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L), .Label = c("0", "1"), class = "factor")), row.names = c(1L, 2L, 3L, 4L, 5L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 25L, 26L, 27L, 28L, 29L, 30L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 47L, 48L, 49L, 50L, 51L, 53L, 54L, 56L, 57L, 58L, 59L, 60L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 70L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 81L, 82L, 85L, 86L, 87L, 88L, 90L, 92L, 94L, 95L, 96L, 97L, 98L, 99L, 100L, 102L, 103L, 104L, 105L, 106L, 107L, 109L, 110L, 111L, 112L, 113L, 114L, 115L, 116L, 117L, 118L, 119L), class = "data.frame") Does anyone know the flaw?
Following #Roland's comment: the plot shows that the within-group variation of the predicted values is much smaller than the observed values. library(ggplot2); theme_set(theme_bw()) lm1 <- lm(length~age+sex,data=dd) pp <- expand.grid(age=30:75,sex=factor(0:1)) pp$length <- predict(lm1,newdata=pp) ggplot(dd,aes(age,length,colour=sex))+ geom_point()+ geom_point(data=pp,shape=2)
Linear Regression - NA's inserted for each category of an independent variable
Overview: I have one dependent variable called 'Tree_diameter', and one independent variable called 'Stand_density_index' (see data frame 1 and 2dbelow). Stand_density_index contains four categories: Standing alone A few trees in close proximity to other trees Within a stand of 10-20 trees large stand or woodland If anyone could please advise which is the correct linear regression approach here: Method 1 Method 2 Method 3 I would be deeply appreciative. Overall Aim of the Question: Using the data from the full database (see data frame 2 below) and the results from an appropriate statistical test, accept or reject the following hypothesis at the 5 % level of significance. Hypothesis: H(0): There is no difference in stem diameter of Quercus robur between the different categories of stand density index From the whole database STATE The statistical test used - linear regression The independent (Tree_diameter) and the dependent variable (Stand_density_index) Justify your conclusion based on this test Method 1 - constructed with data frame 1 Firstly, I summarised the data frame to find the Mean_Tree_Diameter for each category of the Stand_density_index (see categories above). Issues: After I run the linear regression, NA's are being inserted into the results categories. If anyone can help me understand why I would be deeply appreciative. ##Reformat the vectors correctly ##Stand_density_index = as.factor Summarised_QuercusRobur1NewData$Stand_density_index<-as.factor(Summarised_QuercusRobur1NewData$Stand_density_index) ##Recheck the structure of the data frame str(Summarised_QuercusRobur1NewData ##Linear Regression equation SpeciesStemDensity<-lm(Mean_Tree_Diameter~Stand_density_index, data=Summarised_QuercusRobur1NewData) ##Summary Statistics summary(SpeciesStemDensity) ##Summary Statistics Results Method 2 - constructed with data frame 2 In this instance, I used the whole database (see data frame 2) and I reformated 'Stand_density_index' into a factor and run the linear regression model. ##as.factor ##Reformat stand_density_index vector into a categorical vector QuercusRobur1$Stand_density_index<-as.factor(QuercusRobur1$Stand_density_index) ##Linear Regression StemDensityStand<-lm(Tree_diameter~Stand_density_index, data=QuercusRobur1) ##Summary Statistics summary(StemDensityStand) ##Results Method 3 - Constructed from Data frame 2 I ran the linear regression model with the whole database but the 'Stand_density_index' was numeric. ##as numeric ##Reformat stand_density_index into a categorical vector QuercusRobur1$Stand_density_index<-as.numeric(QuercusRobur1$Stand_density_index) ##Linear Regression StemDensityStand<-lm(Tree_diameter~Stand_density_index, data=QuercusRobur1) ##Summary Statistics summary(StemDensityStand) ##Results Data frame 1 structure(list(Stand_density_index = structure(1:4, .Label = c("1", "2", "3", "4"), class = "factor"), Species = structure(c(1L, 1L, 1L, 1L), .Label = "Quercus robur", class = "factor"), Obs_no = c(9L, 82L, 40L, 58L), Mean_Tree_Diameter = c(86.9222222222222, 121.717073170732, 82, 72.4275862068965), SD_Tree_Diameter = c(57.2766046867693, 134.510951231506, 60.202253131019, 61.1575440200358)), row.names = c(NA, -4L), class = "data.frame") Data frame 2 structure(list(Obs_.no = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 44L, 45L, 46L, 47L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 74L, 75L, 81L, 82L, 83L, 84L, 85L, 86L, 87L, 88L, 89L, 90L, 91L, 93L, 102L, 103L, 104L, 112L, 113L, 114L, 115L, 116L, 117L, 118L, 119L, 120L, 121L, 122L, 123L, 124L, 125L, 126L, 127L, 128L, 129L, 130L, 131L, 135L, 136L, 137L, 138L, 143L, 144L, 145L, 146L, 147L, 148L, 149L, 150L, 151L, 152L, 153L, 154L, 155L, 158L, 159L, 160L, 161L, 162L, 163L, 164L, 165L, 169L, 170L, 171L, 172L, 177L, 178L, 179L, 180L, 181L, 182L, 183L, 184L, 185L, 186L, 187L, 188L, 189L, 190L, 191L, 192L, 193L, 194L, 195L, 196L, 200L, 201L, 202L, 203L, 204L, 205L, 206L, 207L, 208L, 210L, 212L, 214L, 215L, 216L, 217L, 218L, 219L, 220L, 221L, 233L, 234L, 235L, 237L, 239L, 246L, 255L, 256L, 257L, 258L, 260L, 261L, 262L, 263L, 264L, 265L, 266L, 277L, 278L, 279L, 280L, 281L, 282L, 283L, 284L, 285L, 286L, 287L, 288L, 289L, 290L, 291L, 292L, 293L, 294L, 295L, 296L), Date_observed = structure(c(4L, 15L, 6L, 6L, 6L, 6L, 2L, 2L, 8L, 8L, 8L, 8L, 8L, 8L, 6L, 6L, 6L, 6L, 6L, 6L, 11L, 11L, 11L, 11L, 12L, 7L, 7L, 9L, 9L, 9L, 9L, 5L, 5L, 5L, 5L, 14L, 14L, 14L, 14L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 6L, 6L, 5L, 5L, 9L, 9L, 9L, 9L, 3L, 3L, 3L, 3L, 4L, 4L, 1L, 1L, 11L, 6L, 6L, 6L, 6L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 3L, 3L, 3L, 3L, 11L, 11L, 11L, 4L, 4L, 4L, 4L, 8L, 8L, 10L, 10L, 10L, 10L, 9L, 9L, 9L, 9L, 3L, 3L, 3L, 3L, 9L, 9L, 9L, 9L, 2L, 2L, 2L, 2L, 13L, 13L, 13L, 13L, 8L, 8L, 8L, 8L, 10L, 10L, 10L, 10L, 3L, 3L, 3L, 3L, 13L, 13L, 13L, 13L, 9L, 9L, 10L, 10L, 10L, 2L, 2L, 3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 5L, 5L, 11L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 11L, 11L, 11L, 11L, 6L, 6L, 6L, 6L, 11L, 11L, 11L, 11L), .Label = c("10/1/18", "10/19/18", "10/20/18", "10/21/18", "10/22/18", "10/23/18", "10/24/18", "10/25/18", "10/26/18", "10/27/18", "10/28/18", "10/28/19", "10/29/18", "12/9/18", "8/20/18"), class = "factor"), Latitude = c(51.4175, 52.12087, 52.0269, 52.0269, 52.0269, 52.0269, 52.947709, 52.947709, 51.491811, 51.491811, 52.59925, 52.59925, 52.59925, 52.59925, 51.60157, 51.60157, 52.6888, 52.6888, 52.6888, 52.6888, 50.697802, 50.697802, 50.697802, 50.697802, 53.62417, 50.446841, 50.446841, 53.959679, 53.959679, 53.959679, 53.959679, 51.78375, 51.78375, 51.78375, 51.78375, 51.456965, 51.456965, 51.456965, 51.456965, 51.3651, 51.3651, 51.3651, 51.3651, 52.01182, 52.01182, 52.01182, 52.01182, 50.114277, 50.114277, 51.43474, 51.43474, 51.10676, 51.10676, 51.10676, 51.10676, 50.435984, 50.435984, 50.435984, 50.435984, 51.78666, 51.78666, 52.441088, 52.441088, 52.552344, 49.259471, 49.259471, 49.259471, 49.259471, 50.461625, 50.461625, 50.461625, 50.461625, 51.746642, 51.746642, 51.746642, 51.746642, 52.2501, 52.2501, 52.2501, 52.2501, 52.423336, 52.423336, 52.423336, 52.423336, 53.615575, 53.615575, 53.615575, 53.615575, 51.08474, 51.08474, 51.08474, 53.19329, 53.19329, 53.19329, 53.19329, 55.96785, 55.96785, 56.52664, 56.52664, 56.52664, 56.52664, 51.8113, 51.8113, 51.8113, 51.8113, 52.580157, 52.580157, 52.580157, 52.580157, 50.52008, 50.52008, 50.52008, 50.52008, 51.48417, 51.48417, 51.48417, 51.48417, 54.58243, 54.58243, 54.58243, 54.58243, 52.58839, 52.58839, 52.58839, 52.58839, 52.717283, 52.717283, 52.717283, 52.717283, 50.740764, 50.740764, 50.740764, 50.740764, 52.57937, 52.57937, 52.57937, 52.57937, 50.736531, 50.736531, 50.79926, 50.79926, 50.79926, 53.675996, 53.675996, 48.35079, 48.35079, 48.35079, 48.35079, 51.36445, 51.36445, 51.36445, 51.36445, 52.122402, 52.122402, 52.122402, 52.16104, 52.16104, 55.91913, 51.6528, 51.6528, 51.6528, 51.6528, 51.88485, 51.88485, 51.88485, 51.88485, 52.34015, 52.34015, 52.34015, 52.026042, 52.026042, 52.026042, 52.026042, 51.319032, 51.319032, 51.319032, 51.319032, 51.51357, 51.51357, 51.51357, 51.51357, 53.43202, 53.43202, 53.43202, 53.43202, 51.50823, 51.50823, 51.50823, 51.50823), Longitude = c(-0.32118, -0.29293, -0.7078, -0.7078, -0.7078, -0.7078, -1.435407, -1.435407, -3.210324, -3.210324, 1.33011, 1.33011, 1.33011, 1.33011, -3.67111, -3.67111, -3.30909, -3.30909, -3.30909, -3.30909, -2.11692, -2.11692, -2.11692, -2.11692, -2.43155, -3.706923, -3.706923, -1.061008, -1.061008, -1.061008, -1.061008, -0.65046, -0.65046, -0.65046, -0.65046, -2.624917, -2.624917, -2.624917, -2.624917, 0.70706, 0.70706, 0.70706, 0.70706, -0.70082, -0.70082, -0.70082, -0.70082, -5.541128, -5.541128, 0.45981, 0.45981, -2.32071, -2.32071, -2.32071, -2.32071, -4.105617, -4.105617, -4.105617, -4.105617, -0.71433, -0.71433, -0.176158, -0.176158, -1.337177, -123.107788, -123.107788, -123.107788, -123.107788, 3.560973, 3.560973, 3.560973, 3.560973, 0.486416, 0.486416, 0.486416, 0.486416, -0.8825, -0.8825, -0.8825, -0.8825, -1.787563, -1.787563, -1.787563, -1.787563, -2.432959, -2.432959, -2.432959, -2.432959, -0.73645, -0.73645, -0.73645, -0.63793, -0.63793, -0.63793, -0.63793, -3.18084, -3.18084, -3.40313, -3.40313, -3.40313, -3.40313, -0.22894, -0.22894, -0.22894, -0.22894, -1.948571, -1.948571, -1.948571, -1.948571, -4.20756, -4.20756, -4.20756, -4.20756, -0.34854, -0.34854, -0.34854, -0.34854, -5.93229, -5.93229, -5.93229, -5.93229, -1.96843, -1.96843, -1.96843, -1.96843, -2.410575, -2.410575, -2.410575, -2.410575, -2.361234, -2.361234, -2.361234, -2.361234, -1.89325, -1.89325, -1.89325, -1.89325, -2.011143, -2.011143, -3.19446, -3.19446, -3.19446, -1.272824, -1.272824, 10.91812, 10.91812, 10.91812, 10.91812, -0.23106, -0.23106, -0.23106, -0.23106, -0.487443, -0.487443, -0.487443, 0.18702, 0.18702, -3.20987, -1.57361, -1.57361, -1.57361, -1.57361, -0.17844, -0.17844, -0.17844, -0.17844, -1.27795, -1.27795, -1.27795, -0.503114, -0.503114, -0.503114, -0.503114, -0.472994, -0.472994, -0.472994, -0.472994, -3.18738, -3.18738, -3.18738, -3.18738, -2.27968, -2.27968, -2.27968, -2.27968, -0.25847, -0.25847, -0.25847, -0.25847), Altitude = c(5L, 0L, 68L, 68L, 68L, 68L, 104L, 104L, 15L, 15L, 23L, 23L, 23L, 23L, 184L, 184L, 176L, 176L, 176L, 176L, 12L, 12L, 12L, 12L, 178L, 36L, 36L, 11L, 11L, 11L, 11L, 210L, 210L, 210L, 210L, 97L, 97L, 97L, 97L, 23L, 23L, 23L, 23L, 0L, 0L, 0L, 0L, 9L, 9L, 4L, 4L, 200L, 200L, 200L, 200L, 160L, 160L, 160L, 160L, 166L, 166L, 0L, 0L, 0L, 47L, 47L, 47L, 47L, 58L, 58L, 58L, 58L, 43L, 43L, 43L, 43L, 97L, 97L, 97L, 97L, 133L, 133L, 133L, 133L, 123L, 123L, 123L, 123L, 128L, 128L, 128L, 15L, 15L, 15L, 15L, 14L, 14L, 65L, 65L, 65L, 65L, 129L, 129L, 129L, 129L, 140L, 140L, 140L, 140L, 18L, 18L, 18L, 18L, 30L, 30L, 30L, 30L, 19L, 19L, 19L, 19L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 96L, 96L, 96L, 96L, 169L, 169L, 169L, 169L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 43L, 43L, 43L, 75L, 75L, 109L, 110L, 110L, 110L, 110L, 95L, 95L, 95L, 95L, 112L, 112L, 112L, 0L, 0L, 0L, 0L, 24L, 24L, 24L, 24L, 38L, 38L, 38L, 38L, 29L, 29L, 29L, 29L, 20L, 20L, 20L, 20L), Species = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = "Quercus robur", class = "factor"), Tree_diameter = c(68.8, 10, 98.5, 97, 32.5, 45.1, 847, 817, 62, 71, 140, 111.4, 114.6, 167.1, 29, 40.1, 68, 45, 60, 54, 104, 122, 85, 71, 81, 39.8, 43.6, 20.1, 17.8, 15.6, 12.1, 81.8, 102.5, 75.5, 57.3, 0.3, 0.2, 0.3, 0.3, 70, 36, 53, 44, 31.5, 27.1, 23.3, 22, 69.4, 37.3, 19.9, 14.6, 196, 122, 118, 180, 58.6, 54.1, 58, 61.5, 58.4, 61, 134, 64, 52.2, 170, 114, 127, 158, 147.4, 135.3, 122.9, 104.1, 263, 237, 322, 302, 175, 182, 141, 155, 89, 41, 70, 83, 141, 86.5, 82, 114.5, 129, 127, 143, 125, 92, 68, 90, 24.5, 20.1, 63.7, 39.8, 66.2, 112.4, 124.5, 94.1, 68.6, 74.4, 23.6, 27.7, 22.9, 25.2, 24.2, 54.7, 43, 33.1, 306, 274, 56, 60, 72.5, 128.5, 22, 16, 143, 103, 53, 130, 48.4, 69.8, 6.4, 18.6, 129.2, 41.7, 57.6, 14, 41.7, 30.2, 39.5, 24.2, 320, 352, 120.9, 108.3, 53.2, 274, 85, 52, 43, 38, 37, 219, 215, 216, 175, 85.9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, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 4, 4, 3, 3, 3, 3, 4, 3, 4, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 3, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 1, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 3, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 2, 1, 1, 2, 1, 1, 1, 4, 4, 4, 4, 3, 3, 3, 3, 4, 4, 4, 2, 3, 3, 3, 3, 2, 2, 2, 2), Canopy_Index = c(85L, 85L, 85L, 75L, 45L, 25L, 75L, 65L, 75L, 75L, 95L, 95L, 95L, 95L, 95L, 65L, 85L, 65L, 95L, 85L, 85L, 85L, 75L, 75L, 65L, 85L, 85L, 75L, 75L, 85L, 65L, 95L, 85L, 95L, 95L, 75L, 75L, 85L, 85L, 85L, 85L, 85L, 75L, 85L, 85L, 85L, 85L, 75L, 75L, 85L, 85L, 65L, 75L, 85L, 75L, 95L, 95L, 95L, 95L, 75L, 65L, 95L, 95L, 55L, 75L, 65L, 75L, 65L, 85L, 95L, 95L, 75L, 95L, 75L, 95L, 65L, 75L, 75L, 85L, 85L, 65L, 95L, 65L, 65L, 65L, 65L, 65L, 65L, 85L, 85L, 75L, 95L, 85L, 85L, 75L, 45L, 55L, 35L, 35L, 25L, 25L, 95L, 85L, 75L, 85L, 85L, 75L, 75L, 65L, 75L, 85L, 65L, 45L, 95L, 95L, 95L, 95L, 65L, 75L, 45L, 35L, 75L, 95L, 95L, 85L, 75L, 65L, 85L, 95L, 75L, 85L, 85L, 95L, 65L, 65L, 45L, 65L, 85L, 35L, 95L, 85L, 85L, 85L, 85L, 75L, 65L, 65L, 65L, 65L, 55L, 75L, 85L, 85L, 95L, 85L, 75L, 75L, 85L, 65L, 45L, 75L, 75L, 65L, 65L, 75L, 65L, 95L, 95L, 95L, 85L, 65L, 75L, 75L, 75L, 65L, 75L, 35L, 75L, 75L, 75L, 75L, 25L, 45L, 45L, 35L, 85L, 95L, 85L, 95L), Phenological_Index = c(2L, 4L, 2L, 2L, 4L, 4L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 1L, 1L, 1L, 1L, 3L, 2L, 3L, 3L, 3L, 3L, 4L, 3L, 2L, 3L, 2L, 2L, 2L, 1L, 3L, 1L, 4L, 2L, 4L, 3L, 3L, 3L, 2L, 2L, 2L, 1L, 2L, 3L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 4L, 3L, 3L, 3L, 2L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 2L)), row.names = c(NA, -189L ), class = "data.frame")
Alice! The issue with you linear regression model is that you do not have enough data to perform a linear regression. Because you have one dependent variable to explain each independent variable, you no need a model, just four equations with four variables to resolve. That is why the intercept is equal to the Mean_Tree_Diameter for Stand_density_index==1 , intercept + Stand_density_index_2 equal to Mean_Tree_Diameter for Stand_density_index==2... Also, that is why your Multiple R Squared is 1. Your model is perfect! So, either you do not use Stand_density_index in you model or you include more data (several values of Mean_Tree_Diameter for the same Mean_Tree_Diameter) or you will always get this results. If you try your model with this data: Summarised_QuercusRobur1NewData<-structure(list(Stand_density_index = structure(c(1,1,2,2), .Label = c("1", "2"), class = "factor"), Species = structure(c(1L, 1L, 1L, 1L), .Label = "Quercus robur", class = "factor"), Obs_no = c(9L, 82L, 40L, 58L), Mean_Tree_Diameter = c(86.9222222222222, 121.717073170732, 82, 72.4275862068965), SD_Tree_Diameter = c(57.2766046867693, 134.510951231506, 60.202253131019, 61.1575440200358)), row.names = c(NA, -4L), class = "data.frame") You will get some results, because now you have 4 different independent variable results for only 2 different dependent variables.
Gaussian function model in R
I have a dataset of barnacle density and coral cover by photo from two coral reef locations. I want to see if there is a pattern in barnacle density with depth or coral cover. I have tried linear models and a negative binomial with the formula m2 <- glm.nb(dens.cm ~ depth + coral.cover+location+depth:location, data =data) However, after looking at a distribution of the density data with depth, I think a Gaussian function may better explain the patterns. Density of barnacles per m2 by depth (m) and location I am looking for advice on how to design a Gaussian model for my data in R. Any advice is appreciated! > dput(dat) structure(list(photo = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 95L, 96L, 97L, 98L, 99L, 100L, 101L, 102L, 103L, 104L, 105L, 106L, 107L, 108L, 109L, 110L, 111L, 112L, 113L, 50L, 51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L, 73L, 74L, 75L, 76L, 77L, 78L, 79L, 80L, 81L, 82L, 83L, 84L, 85L, 86L, 87L, 88L, 89L, 90L, 91L, 92L, 93L, 94L, 114L, 115L, 116L, 117L, 118L, 119L, 120L, 121L, 122L, 123L, 124L, 125L, 126L, 127L, 128L, 129L, 130L, 131L, 132L, 133L, 134L), .Label = c("101", "102", "103", "104", "105", "106", "107", "108", "201", "202", "203", "204", "205", "206", "207", "208", "209", "210", "211", "212", "301", "302", "303", "304", "305", "306", "307", "501", "502", "503", "504", "505", "506", "507", "508", "509", "510", "511", "512", "513", "601", "602", "603", "604", "605", "606", "607", "608", "609", "6157", "6173", "6177", "6178", "6181", "6182", "6199", "6201", "6202", "6203", "6210", "6211", "6214", "6222", "6237", "6241", "6245", "6256", "6260", "6261", "6296", "6297", "6299", "6302", "6304", "6308", "6309", "6311", "6312", "6313", "6314", "6315", "6320", "6322", "6323", "6324", "6325", "6326", "6327", "6328", "6329", "6424", "6426", "6428", "6431", "701", "702", "703", "704", "705", "706", "707", "708", "709", "801", "802", "803", "804", "805", "806", "807", "808", "809", "810", "D01", "D02", "D03", "D04", "D05", "D06", "D07", "D08", "D10", "D11", "D12", "D13", "D14", "D15", "D16", "D17", "D18", "D19", "D20", "D21", "D22"), class = "factor"), location = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("fgb", "usvi"), class = "factor"), depth = c(19.5072, 19.812, 21.5, 20.7264, 21.336, 19.5072, 19.812, 20.0312, 21.9456, 23.4696, 23.4696, 24.0792, 23.1648, 23.4696, 21.336, 19.5072, 20.1168, 20.7264, 21.0312, 21.0312, 21.9456, 20.4216, 19.5072, 21.0312, 22.2504, 21.9456, 20.4216, 20.4216, 20.4216, 21.336, 20.7264, 20.7264, 20.4216, 20.4216, 19.812, 20.1168, 20.1168, 20.7264, 19.812, 21.9456, 22.86, 22.2504, 21.9456, 22.5552, 22.2504, 21.0312, 21.336, 21.336, 21.6408, 23.4696, 23.7744, 21.9456, 22.2504, 22.2504, 21.6408, 22.2504, 22.2504, 21.5, 23.1648, 22.5552, 22.2504, 22.5552, 22.2504, 21.9456, 21.85, 22.2504, 24.0792, 22.2504, 15, 15, 15, 15, 15, 15, 13, 13, 13, 13, 13, 13, 13, 21, 21, 21, 21, 7, 7, 7, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 38, 38, 38, 38, 32.6992, 29.5656, 31.0896, 31.0896, 32.6136, 33.8328, 35.3568, 35.3568, 31.0896, 37.7952, 29.5656, 31.0896, 31.0896, 32.6136, 33.8328, 35.3568, 35.3568, 36.8808, 37.7952, 37.7952, 38.1), dens.m = c(267.86719, 350.47852, 431.81125, 622.71004, 599.24271, 1420.18674, 193.38521, 161.44909, 910.49021, 110.35386, 479.12616, 408.42407, 315.60503, 74.8805, 104.48846, 137.99029, 469.71577, 356.37609, 950.49046, 272.49611, 528.00183, 269.93556, 480.50256, 118.2897, 185.00516, 438.49583, 276.08897, 227.43988, 86.33476, 185.46051, 84.80511, 451.02732, 400.5159, 163.67933, 90.92022, 137.38598, 202.10666, 159.44588, 197.77431, 453.77111, 101.17702, 134.19122, 122.93134, 429.97449, 430.17319, 1153.40396, 214.65884, 1342.54685, 578.08208, 578.44438, 252.6739, 2174.60653, 354.51124, 340.84014, 390.41988, 244.08631, 806.81267, 651.94004, 57.84774, 303.84401, 411.5247, 555.01574, 118.71732, 94.01832, 572.41467, 444.28938, 123.78678, 320.6036361, 0, 0, 49.41053235, 0, 125.6693464, 0, 93.84212658, 198.2007337, 327.6507767, 907.6881184, 0, 239.4739237, 0, 0, 443.5415909, 0, 51.88753895, 401.7879564, 0, 428.9613238, 0, 17.05628117, 0, 0, 0, 62.93519689, 0, 14.42007124, 0, 0, 0, 52.11494159, 0, 0, 0, 0, 0, 0, 0, 10.83275387, 141.8632389, 0, 0, 0, 0, 446.919281, 132.8611692, 143.198051, 33.05694578, 167.1561242, 51.78159277, 99.97872, 75.88997, 502.1027409, 354.7612359, 18.01753245, 59.73474983, 101.6708376, 192.2764503, 279.5383788, 138.1696187, 289.6458105, 166.5402349, 65.25117077, 649.1753683, 346.42269), coral.cover = c(28.52606, 11.05908, 31.28802, 28.91658, 3.54822, 12.18002, 16.72137, 1.92059, 23.42574, 64.22509, 37.25867, 48.04682, 58.10703, 36.08555, 45.99744, 67.4129, 41.21151, 53.32379, 14.54049, 40.63984, 57.09064, 42.2561, 39.77932, 23.7793, 35.67588, 28.4876, 35.53832, 21.61865, 35.1461, 14.45028, 45.70443, 52.544, 53.58537, 27.60442, 16.56497, 6.12609, 31.23248, 48.8958, 25.30934, 40.41436, 28.02014, 36.47627, 28.28651, 13.44436, 25.07424, 38.02122, 49.11345, 7.12683, 24.52069, 15.27754, 35.67601, 8.35171, 1.87428, 6.0433, 20.08231, 13.70174, 39.39322, 9.61437, 10.3376, 50.15105, 37.62041, 39.14767, 41.23067, 38.1632, 46.12196, 16.10196, 36.32152, 44.90422, 2.0575, 12.13155, 5.20272, 5.34756, 4.0912, 0.60427, 5.47876, 1.29702, 0.78458, 0.56643, 0.75587, 2.14695, 8.99664, 0.73209, 1.15917, 1.40533, 4.95436, 0.63981, 1.03059, 1.19857, 0.38732, 60.28733, 25.67675, 10.33979, 13.07546, 4.08467, 6.10119, 35.65439, 5.54589, 15.93534, 6.06176, 9.86548, 7.00005, 21.27449, 12.13181, 26.65331, 5.83493, 14.69534, 6.87034, 23.73075, 7.24837, 1.58201, 2.56882, 0.35245, 20.23897, 42.96672, 44.67648, 28.76856, 37.52041, 40.01538, 4.705, 29.9067, 30.06042, 7.45481, 14.35932, 8.60488, 16.68506, 23.30932, 14.51399, 33.59438, 38.95256, 43.35688, 2.65983, 9.84355, 37.1201, 50.76407)), .Names = c("photo", "location", "depth", "dens.m", "coral.cover"), class = "data.frame", row.names = c(NA, -134L))
Error using the step-function with glmmML
When I tried to use the step function I receive this error: "Error in if (all(is.finite(c(n0, nnew))) && nnew != n0) stop("number of rows in use has changed: remove missing values?") : missing value where TRUE/FALSE needed" Seems like it has something to do with missing values. I checked for this and there are none. I searched for more information around this error. I could only find one unanswered post from several years ago. I've included random sample selection from my dataset, together with the R-code I used. (SD=integer. DIST,CD=numeric. Hunt,Region,DN,IDcat=categorical). Sika.sample <- structure(list(ID = c(16L, 19L, 68L, 58L, 35L, 21L, 21L, 83L, 48L, 64L, 73L, 63L, 80L, 63L, 8L, 43L, 77L, 75L, 27L, 73L, 22L, 65L, 32L, 78L, 61L, 68L, 46L, 30L, 44L, 78L, 58L, 72L, 27L, 46L, 41L, 52L, 36L, 38L, 67L, 18L, 45L, 75L, 72L, 8L, 5L, 62L, 70L, 23L, 4L, 8L, 7L, 30L, 37L, 7L, 68L, 20L, 80L, 44L, 39L, 6L, 83L, 26L, 66L, 21L, 5L, 39L, 10L, 73L, 69L, 44L, 51L, 69L, 53L, 63L, 27L, 29L, 15L, 13L, 1L, 18L, 31L, 9L, 42L, 32L, 78L, 62L, 23L, 3L, 29L, 49L, 81L, 60L, 70L, 73L, 8L, 69L, 79L, 19L, 47L, 38L ), SD = c(8L, 3L, 4L, 6L, 2L, 1L, 8L, 0L, 4L, 2L, 8L, 2L, 0L, 8L, 0L, 0L, 2L, 2L, 0L, 3L, 0L, 2L, 25L, 0L, 18L, 28L, 0L, 10L, 1L, 0L, 0L, 1L, 0L, 10L, 1L, 0L, 0L, 7L, 0L, 0L, 18L, 0L, 0L, 0L, 0L, 28L, 1L, 0L, 10L, 1L, 0L, 2L, 0L, 0L, 3L, 7L, 0L, 0L, 8L, 0L, 5L, 1L, 3L, 33L, 1L, 3L, 0L, 1L, 0L, 0L, 19L, 0L, 3L, 3L, 0L, 1L, 0L, 3L, 5L, 2L, 0L, 0L, 0L, 2L, 0L, 10L, 0L, 0L, 0L, 0L, 2L, 0L, 2L, 0L, 8L, 1L, 0L, 0L, 0L, 0L), DIST = c(0, 0, 42.7, 800.6, 44.6, 0, 0, 19.3, 42.8, 570.7, 111.7, 348.2, 0, 348.2, 24, 0, 7.6, 3.1, 23.2, 111.7, 0, 404, 331.9, 0, 0, 42.7, 0, 97.7, 0, 0, 800.6, 295.5, 23.2, 0, 0, 0, 4.3, 29.5, 408.1, 37.7, 0, 3.1, 295.5, 24, 15.5, 0, 34.1, 0, 22.1, 24, 223.4, 97.7, 99.1, 223.4, 42.7, 75.2, 0, 0, 279.5, 28, 19.3, 58, 972.3, 0, 15.5, 279.5, 652.8, 111.7, 24.8, 0, 0, 24.8, 0, 348.2, 23.2, 278.8, 20.1, 30.6, 4.9, 37.7, 46.3, 735.7, 1.2, 331.9, 0, 0, 0, 5.8, 278.8, 817.6, 0, 190.4, 34.1, 111.7, 24, 24.8, 11.3, 0, 0, 29.5), CD = c(103.9, 25.3, 46.6, 99.4, 55, 95.2, 68, 62.5, 59, 78.8, 65.5, 46.6, 51.8, 78.2, 52.7, 15.7, 62.8, 81.3, 40.9, 82.5, 64.9, 50.1, 62, 56.1, 88.9, 77.2, 48.1, 69.2, 37.9, 101.8, 43.9, 82.4, 57, 75.1, 41.9, 42.2, 48.7, 53.3, 42, 61, 70.9, 38, 51.9, 39.3, 44.9, 69.7, 25.1, 49, 61.8, 58, 61.2, 41.1, 90.3, 45.8, 36.4, 103.1, 52.4, 84.6, 63.5, 53.5, 101.1, 64.4, 50, 80.8, 75.1, 47.5, 79.7, 44.9, 37, 29.1, 65.9, 49, 56.7, 61.4, 31.1, 102.7, 64.8, 51.4, 80.7, 61.6, 36, 50.3, 42.4, 47, 41.9, 68.4, 88.9, 56.2, 52.1, 50.1, 69.1, 55.1, 48.4, 34.1, 51, 77.9, 53.5, 36.8, 48.2, 38.7), DN = structure(c(1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L), .Label = c("Day", "Night"), class = "factor"), Hunt = structure(c(2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L ), .Label = c("Hunt", "Nohunt"), class = "factor"), Region = structure(c(2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L), .Label = c("H", "S"), class = "factor"), IDcat = structure(c(16L, 19L, 68L, 58L, 35L, 21L, 21L, 83L, 48L, 64L, 73L, 63L, 80L, 63L, 8L, 43L, 77L, 75L, 27L, 73L, 22L, 65L, 32L, 78L, 61L, 68L, 46L, 30L, 44L, 78L, 58L, 72L, 27L, 46L, 41L, 52L, 36L, 38L, 67L, 18L, 45L, 75L, 72L, 8L, 5L, 62L, 70L, 23L, 4L, 8L, 7L, 30L, 37L, 7L, 68L, 20L, 80L, 44L, 39L, 6L, 83L, 26L, 66L, 21L, 5L, 39L, 10L, 73L, 69L, 44L, 51L, 69L, 53L, 63L, 27L, 29L, 15L, 13L, 1L, 18L, 31L, 9L, 42L, 32L, 78L, 62L, 23L, 3L, 29L, 49L, 81L, 60L, 70L, 73L, 8L, 69L, 79L, 19L, 47L, 38L), .Label = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "80", "81", "82", "83"), class = "factor")), .Names = c("ID", "SD", "DIST", "CD", "DN", "Hunt", "Region", "IDcat"), row.names = c(16L, 172L, 328L, 222L, 86L, 21L, 174L, 332L, 308L, 228L, 96L, 291L, 233L, 259L, 161L, 271L, 202L, 98L, 180L, 45L, 22L, 293L, 185L, 203L, 257L, 264L, 274L, 81L, 304L, 50L, 286L, 95L, 27L, 242L, 269L, 280L, 138L, 191L, 295L, 171L, 241L, 149L, 146L, 110L, 107L, 258L, 195L, 125L, 55L, 8L, 160L, 183L, 37L, 109L, 296L, 20L, 297L, 208L, 192L, 6L, 236L, 179L, 294L, 72L, 5L, 141L, 10L, 198L, 143L, 272L, 311L, 194L, 249L, 323L, 129L, 29L, 66L, 166L, 52L, 69L, 133L, 162L, 270L, 134L, 152L, 322L, 23L, 156L, 182L, 277L, 330L, 288L, 42L, 147L, 59L, 41L, 204L, 19L, 275L, 140L), class = "data.frame") Glmm_full <- glmmML(SD~DIST*as.factor(Hunt)*as.factor(Region)*as.factor(DN), offset=log(CD),data=Sika.sample,family="poisson",cluster=IDcat) finalModel <-step(Glmm_full) #ERROR-MESSAGE