I have a column in my dataset that contains a dummy-variable educ_pers
if the educational level of the respondant is the same as his/her parents'. Each row in this dataset is one respondant. The data looks somewhat like this:
set.seed(1)
Data <- data.frame(
idno = sample(1:10),
educ_pers = sample(c("1", "0"), 10, replace = TRUE)
)
where idno
is the id number of the respondant and educ_pers
indicates whether the indivdual has the same educational level compared to his/her parents educ_pers==1
and educ_pers==0
if educational levels differ.
To obtain the educational persistance, I would like to calculate the probability of a randomly chosen individual from the cohort to have educ_pers == 1
. If possible, a 95% confidence interval around the probability would be ideal!
Thanks a lot in advance!