Please I have unbalanced panel data and I want to estimate a threshold regression using PSTR function in R. I get error message whenever I run NewPSTR and EstPSTR functions.
If I run the following function
pstr = NewPSTR(df, dep='Growth', indep=5:6, indep_k=c('Lerner','Inflation'), tvars=c('Lerner'), iT=6)
I get the error message below 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.