In this paper, we study estimation of fixed and random effects nonparametric panel data models using penalized splines and its mixed model variant. We define a "within" and a "dummy variable" estimator and show their equivalence which can be used as an argument for consistency of the dummy variable estimator when the effects are correlated with regressors. We prove nonparametric counterparts to a variety of the relations between parametric fixed and random effects estimators. Another feature of the approach followed in this paper is the potential to estimate models with heteroscedasticity and autocorrelation in the error term without difficulty. We provide a simulation experiment to illustrate the performance of the estimators.