The DHS Program User Forum
Discussions regarding The DHS Program data and results
Today's Messages (off)  | Unanswered Messages (on)

Forum: Fertility
 Topic: R code for TFR estimation -SAE perspective
R code for TFR estimation -SAE perspective [message #24732] Wed, 29 June 2022 10:18
DIO is currently offline  DIO
Messages: 2
Registered: March 2020
Member
I am trying to calculate TFR in DHS.rates using Kenya DHS data 2014 with purpose of attempting further modelling in small area estimation (SAE). However I am getting the following error:

> setwd("~/scountytfr")
> library(DHS.rates)
> library(haven)
> KEIR2014sbset <- read_dta("C:/Users/DAVID/Documents/scountytfr/KEIR2014sbset.dta ")
> fert(KEIR2014sbset,Indicator = "tfr", JK = "Yes", Class="Sub_Countyn")

The current function calculated TFR based on a reference period of 36 months
The reference period ended at the time of the interview, in 2014.58 OR May - Oct 2014
The average reference period is 2013.08
Error in matrix(0, nrow = max(as.numeric(Dat$DomID)), ncol = 10) :
invalid 'nrow' value (too large or NA)

What to do?



Current Time: Wed Jun 29 21:12:42 Coordinated Universal Time 2022