Please I have unbalanced panel data and I want to estimate a threshold regression using PSTR function in R. To create a new object of the class PSTR, I run the function below:
pstr = NewPSTR(df, dep='Growth', indep=5:6, indep_k=c('Lerner','Inflation'), tvars=c('Lerner'), iT=6)
But I keep getting the following error message which I don't know the reason
Error in `vY[tmp, ]`:
! Can't subset rows with `tmp`.
✖ Logical subscript `tmp` must be size 1 or 8966, not 8964.
Run `rlang::last_trace()` to see where the error occurred.
Please how do I treat this error? Is it because the panel data is not balanced? I would be grateful if someone assists me to fix this error, thanks.