0

I have a continuous distribution comming from a survey data and summarized in a table wth three columns wheres the first column X1 is the lower bound of the interval, X2 is the upper one and n is the size of each interval. enter image description here to import data I use the following code

dat <- data.frame( X1 = c(16, 18, 20, 22), X2 = c(18, 20, 22,24), n = c(10, 30, 40,20))

and to caculate frequence I apply this code

data.frame(X1,X2,ci=(X1+X2)/2,Eff=n,EffCum=cumsum(n),Freq=n/sum(n),FreqCum=cumsum(n/sum(n)))

can you please help me how I can determine characteristics of this distribution (mode, mean, median, variance) knowing that when I used this code

summary(dat)

it appears that R did not take into consideration that X1 and X2 are the two bounds of an interval and it considers them as discrete data. the output founded is like this: X1 X2 n
Min. :16.0 Min. :18.0 Min. :10.0
1st Qu.:17.5 1st Qu.:19.5 1st Qu.:17.5
Median :19.0 Median :21.0 Median :25.0
Mean :19.0 Mean :21.0 Mean :25.0
3rd Qu.:20.5 3rd Qu.:22.5 3rd Qu.:32.5
Max. :22.0 Max. :24.0 Max. :40.0
can you help me please?

I have a continuous distribution comming from a survey data and summarized in a table wth three columns wheres the first column X1 is the lower bound of the interval, X2 is the upper one and n is the size of each interval. enter image description here to import data I use the following code

dat <- data.frame( X1 = c(16, 18, 20, 22), X2 = c(18, 20, 22,24), n = c(10, 30, 40,20))

and to caculate frequence I apply this code

data.frame(X1,X2,ci=(X1+X2)/2,Eff=n,EffCum=cumsum(n),Freq=n/sum(n),FreqCum=cumsum(n/sum(n)))

can you please help me how I can determine characteristics of this distribution (mode, mean, median, variance) knowing that when I used this code

summary(dat)

it appears that R did not take into consideration that X1 and X2 are the two bounds of an interval and it considers them as discrete data. the output founded is like this: X1 X2 n
Min. :16.0 Min. :18.0 Min. :10.0
1st Qu.:17.5 1st Qu.:19.5 1st Qu.:17.5
Median :19.0 Median :21.0 Median :25.0
Mean :19.0 Mean :21.0 Mean :25.0
3rd Qu.:20.5 3rd Qu.:22.5 3rd Qu.:32.5
Max. :22.0 Max. :24.0 Max. :40.0
can you help me please?

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161

0 Answers0