0

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!

mdewey
  • 16,541
  • 22
  • 30
  • 57
PaulB
  • 1
  • 1
  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. I'm unclear if you are asking for programming help or statistics help. The latter should be asked at [stats.se] – MrFlick Jul 14 '20 at 15:24
  • @MrFlick sure my bad, does this help? –  Jul 14 '20 at 16:28

0 Answers0