Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Levene Test for two groups with different length

$
0
0

I have two different groups with different ages in it, and I would like to compare variance by Levene test but it didn't work.

leveneTest(Total_Dem$age~Total_Rep$age)

The output was Error in model.frame.default(form) : variable lengths differ (found for 'Total_Rep$age'), and I have no idea what to do next.

Here's the data dput(Total_Dem$age)

c(59, 62, 51, 67, 36, 66, 61, 72, 68, 70, 55, 61, 89, 74, 66, 
79, 69, 77, 65, 51, 73, 66, 68, 78, 70, 77, 67, 74, 56, 81, 63, 
49, 70, 50, 64, 72, 68, 33, 65, 70, 75, 65, 53, 63, 74, 63, 59, 
72, 67, 33, 67, 64, 57, 74, 71, 30, 52, 62, 78, 54, 62, 58, 70, 
54, 35, 63, 64, 63, 73, 73, 72, 58, 72, 64, 71, 55, 74, 64, 39, 
30, 33, 52, 28, 62, 61, 80, 40, 63, 60, 44, 51, 40, 23, 63, 43, 
39, 61, 34, 72, 32, 31, 24, 40, 66, 32, 64, 21, 69, 32, 80, 40, 
21, 30, 26, 49, 59, 53, 67, 62, 53, 34, 88, 55, 66, 60, 22, 61, 
38, 38, 67, 36, 48, 29, 72, 33, 57, 29, 48, 64, 51, 55, 71, 38, 
79, 68, 25, 61, 47, 42, 39, 57, 38, 44, 69, 79, 40, 75, 59, 32, 
75, 28, 34, 77, 75, 58, 56, 64, 64, 79, 60, 61, 53, 49, 36, 41, 
71, 40, 54, 71, 32, 43, 44, 33, 67, 65, 67, 70, 56, 49, 34, 64, 
59, 57, 53, 70, 54, 54, 53, 74, 65, 60, 79, 60, 60, 61, 34, 69, 
42, 62, 73, 53, 61, 41, 70, 80, 76, 64, 67, 68, 71, 33, 27, 68, 
30, 59, 64, 51, 76, 65, 76, 70, 35, 35, 60, 31, 47, 56, 58, 32, 
34, 46, 68, 41, 87, 37, 57, 53, 80, 67, 66, 61, 44, 58, 66, 61, 
80, 59, 30, 75, 82, 66, 59, 60, 80, 71, 51, 43, 48, 33, 77, 49, 
27, 63, 45, 75, 34, 42, 19, 48, 71, 52, 47, 57, 57, 56, 49, 80, 
56, 29, 60, 55, 57, 45, 60, 64, 55, 29, 50, 41, 26, 27, 67, 26, 
32, 65, 81, 26, 63, 77, 47, 55, 24, 28, 73, 67, 36, 29, 57, 51, 
44, 39, 67, 38, 75, 82, 52, 61, 75, 72, 64, 21, 36, 30, 52, 59, 
53, 31, 46, 38, 51, 61, 50, 59, 55, 53, 71, 53, 68, 76, 63, 56, 
39, 35, 75, 66, 33, 66, 62, 61, 57, 24, 57, 54, 61, 52, 38, 48, 
65, 53, 36, 69, 75, 39, 88, 60, 66, 51, 73, 67, 75, 59, 80, 60, 
64, 60, 51, 28, 37, 71, 37, 67, 61, 62, 45, 64, 58, 34, 69, 57, 
49, 68, 81, 47, 55, 66, 42, 60, 49, 62, 59, 49, 22, 75, 56, 47, 
34, 42, 34, 27, 45, 70, 73, 54, 74, 66, 75, 54, 31, 48, 58, 33, 
50)

dput(Total_Rep$age)

c(33, 30, 57, 71, 60, 73, 70, 60, 64, 83, 60, 75, 55, 73, 67, 
70, 69, 77, 74, 48, 77, 60, 56, 55, 75, 70, 34, 37, 58, 69, 65, 
61, 68, 23, 81, 64, 66, 65, 72, 56, 59, 62, 71, 80, 63, 71, 56, 
62, 66, 66, 88, 69, 45, 73, 79, 70, 50, 58, 83, 84, 61, 46, 47, 
64, 60, 55, 58, 48, 64, 72, 65, 87, 61, 65, 60, 25, 36, 51, 64, 
64, 61, 75, 65, 26, 67, 59, 58, 62, 41, 61, 70, 89, 57, 66, 68, 
73, 84, 46, 43, 63, 71, 20, 62, 67, 71, 39, 54, 54, 41, 42, 39, 
51, 74, 42, 47, 56, 74, 53, 70, 66, 58, 67, 83, 64, 48, 30, 53, 
44, 54, 71, 77, 51, 62, 62, 68, 25, 56, 91, 61, 61, 62, 61, 70, 
45, 42, 76, 66, 64, 80, 80, 58, 65, 68, 66, 47, 55, 55, 56, 54, 
81, 70, 59, 78, 44, 55, 70, 63, 60, 43, 73, 65, 73, 80, 81, 25, 
60, 80, 62, 52, 58, 73, 54, 71, 72, 77, 57, 24, 69, 79, 72, 62, 
38, 63, 67, 52, 41, 59, 59, 78, 58, 70, 66, 51, 70, 54, 64, 74, 
54, 34, 60, 37, 65, 79, 48, 31, 55, 63, 36, 59, 62, 34, 69, 60, 
47, 58, 55, 56, 59, 29, 84, 87, 80, 65, 49, 62, 27, 60, 67, 73, 
76, 65, 28, 73, 50, 81, 44, 39, 36, 30, 70, 54, 69, 28, 67, 65, 
40, 53, 66, 80, 88, 58, 55, 63, 53, 54, 20, 81, 72, 75, 67, 57, 
58, 34, 32, 47, 67, 52, 63, 78, 42, 50, 30, 32, 83, 58, 67, 26, 
56, 21, 25, 62, 64, 64, 33, 69, 28, 56, 62, 62, 51, 56, 61, 70, 
67, 63, 51, 35, 70, 61, 71, 56, 44, 62, 44, 77, 26)

The length of two groups are different, and I would like to perform Levene's test with this samples.


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>