Essays on large panel data models with two-way heterogeneity