powered by
Function to return mean age from a data frame
get_mean_sd_age(this_data, age_nrcode)
mean and sd, if success -1, if failure
the data containing column with age
non response code
Age data is complete with the nr code given and get the mean and sd
this_data <- as.data.frame(cbind(num = c(1, 2, 3, 4), age = c(14, 25, 26, 30))) get_mean_sd_age(this_data, NA)
Run the code above in your browser using DataLab