How do I solve two factors model?

seems it is complaining about dt being a float - try casting it to int should help.