Testing for Trend Specifications in Panel Data Models

Abstract This article proposes a consistent nonparametric test for common trend specifications in panel data models with fixed effects. The test is general enough to allow for heteroscedasticity, cross-sectional and serial dependence in the error components, has an asymptotically normal distribution under the null hypothesis of correct trend specification, and is consistent against various alternatives that deviate from the null. In addition, the test has an asymptotic unit power against two classes of local alternatives approaching the null at different rates. We also propose a wild bootstrap procedure to better approximate the finite sample null distribution of the test statistic. Simulation results show that the proposed test implemented with bootstrap p-values performs reasonably well in finite samples. Finally, an empirical application to the analysis of the U.S. per capita personal income trend highlights the usefulness of our test in real datasets.


Introduction
Panel data with large T is becoming more and more popular in empirical studies. Understanding the empirical patterns in such datasets is an important guiding principle for success in analyzing the data and forecasting their future behavior. At a casual level, many observed panel data with large T seem to display trending characteristics. For some economic observations, trending behavior is often the most dominant characteristic. Growth characteristics are especially evident in time series that represent aggregate economic behaviors. Any attempt to explain or forecast series of this type requires that a mechanism be introduced to capture the trend component in the data, or that the series be transformed/detrended in some way for convenience of further analysis. Different types of trending behaviors may be found in different time series. Some series grow in a secular way over long periods of time and are best characterized using appropriate deterministic trends, others appear to wander around as if they have no fixed population means and are usually modeled by stochastic trends (unit roots). Statistical inference or prediction based on such kind of data requires a correct specification and analysis of the major patterns in the corresponding dataset.
The secular trend describes the history of the data, it provides the long term direction of the series and plays an important role in making prediction about the future of the corresponding sequence. Up to now, various forms of deterministic trends have been proposed in empirical applications. Some, such as time polynomials, are constructed to capture global movements (see Feng and Serletis 2008), others display local and nonlinear behaviors and are better captured by nonparametric models (Robinson 2012). While a nonparametric specification provides more robust mechanism for the trend, a correctly specified parametric trend delivers much more efficient estimation, which is important in prediction, particularly when researchers are interested in relatively long-run prediction. Therefore, it is important to use the trending features carefully, especially when their future real values are unclear. If the trend patterns are correctly detected, researchers will be able to build good forecast models based on them. A prediction based on misspecified trends is highly risky as it can cause substantial errors and provide incorrect results. In addition to prediction, many other statistical inferences are also crucially dependent on correct specifications of the trends. Choosing trend functions and implementing detrending operations are important steps in statistical analysis in such datasets. Mistakes in specification of the trending components could easily get compounded resulting in completely wrong results, so extreme caution on trend specifications is in order, see, for example, Phillips and Xiao (1998), Perron (2006), and Harvey, Leybourne, and Taylor (2009). To avoid serious consequences of misspecification, it is important to examine the adequacy of the parametric trend model before we embark on statistical inference. There is an ever increasing literature to test for trend function specifications of time series models, see, for example, Juhl and Xiao (2005), Gao and Hawthorne (2006), Zhang and Wu (2011), and Wu and Xiao (2018a), among others. On the other hand, much less attention has been paid to the corresponding problem in panel data models although parametric trend models are widely studied and used to capture the common trends of panel data in practice, see, for example, Baltagi and Krämer (1997), Song, Stemann, and Jung (2002), Emerson (2002a, 2002b), and Kim (2011), to mention only a few.
Up to now, various specification tests for parametric panel data models have been proposed in the literature; see, for example, Hausman (1978), Hausman and Taylor (1981), Arellano and Bond (1991), Metcalf (1996), Baltagi (1999), Fu, Li, and Fung (2002), Inoue and Solon (2006), and Okui (2009), amongst others. But none of these tests are designed to check the trend specifications of panel data models. To the best of our knowledge, there exist only a few tests of functional form specifications that are related to our current work. To choose between parametric, semiparametric and nonparametric specifications, Henderson, Carroll, and Li (2008) propose three nonparametric test statistics without establishing their limiting null distributions and suggest implementing these statistics through bootstrap procedures to better approximate their finite sample null distributions. Lin, Li, and Sun (2014) propose a consistent test for linearity in a static fixed effects panel data model and establish a limiting standard normal distribution under the null hypothesis using the second-order degenerate U-statistic theory. Su and Lu (2013) construct an L 2 -type test to check the correct specification of linearity in a typical dynamic panel data model. On the other hand, based on a 2-fold V-statistic, Su, Jin, and Zhang (2015) extend the test of Lin, Li, and Sun (2014) to detect against nonlinearity in both static and dynamic panel models with interactive fixed effects. Finally, Lee (2014) proposes a class of residual-based specification tests for linearity in dynamic panel data models. All these test statistics are designed to check the adequacy of parametric (e.g., linear) forms against nonparametric/semiparametric alternatives and rule out the important case of specification tests for trend forms in panel data models with fixed effects.
Meanwhile, several tests are proposed to check whether panel data follow the same trending behavior as well. For example, Vogelsang and Franses (2005) assume linear trend functions and examine whether two or more trend-stationary time series have the same slope. Xu (2012) considers tests for multivariate linear deterministic trend coefficients in the presence of time-varying variances. Similarly, Sun (2011) develops a testing procedure for linear deterministic trends in a long panel model where the long run variance matrix is estimated by a series type estimator. Zhang, Su, and Phillips (2012) also construct a consistent test to check whether the panel data share the same nonparametric trend function over time. To establish the asymptotic distribution of their test statistic, they allow for cross-sectional dependence but assume the error components to follow a martingale difference sequence (MDS) and thus, rule out serial dependence. However, in all these cases, the models are not concerned with testing for correct specifications of common trends.
The goal of this article is to propose a consistent nonparametric test for the common trend specifications in panel data models with fixed effects. Our approach enjoys several appealing features. First, the proposed test is consistent against various alternatives that deviate from the null hypothesis, and no prior information about the alternatives are required for our test. Second, our test is general enough to allow for heteroscedasticity, cross-sectional and serial dependence in the error components. Third, unlike many tests for model specifications in the literature, which often have nonstandard asymptotic null distributions, the proposed test has an asymptotically normal distribution under the null hypothesis, and it is easy to implement the testing procedure in empirical applications.
The remainder of this article is organized as follows. In Section 2.1 we introduce the panel data model with a common time trend and describe our hypotheses of interest. Section 2.2 discusses the U-statistic that constitutes the basis upon which our proposed test statistic is developed. In Section 3.1 we study the asymptotic distribution of the proposed test statistic under the null hypothesis. Section 3.2 investigates the asymptotic power properties of our test statistic under a fixed alternative and two classes of local alternatives that converge to the null hypothesis at different rates. In Section 3.3. we introduce a wild bootstrap procedure to better approximate the finite sample distribution of our test statistic under the null and we also justify theoretically the validity of the proposed bootstrap method. In Section 4.1 we investigate the issue of bandwidth selection. Section 4.2 presents the results of Monte Carlo simulations to assess the finite sample performance of our test statistic. Section 5 illustrates the applicability of our test in the context of an empirical analysis of common trend specifications using the U.S. per capita personal income data. Section 6 concludes. Mathematical proofs of the main results and further simulation results can be found in the Appendices A and B, supplementary materials, respectively.

Hypotheses of Interest
In this section we introduce the panel data time trend model and our hypotheses of interest. Suppose we observe the panel data of y it , i = 1, . . . , N, t = 1, . . . , T , where y it is a scalar dependent variable of interest, N the number of panel individuals and T the number of time periods. As in Robinson (2012), we consider the following model for y it where α i represents the unobserved individual-specific effect that satisfies N i=1 α i = 0, and u it is the error component. To allow for flexible error structure, later we introduce heteroscedasticity, cross-sectional and serial dependence in u it . Following Robinson (2012), we assume that g t = g (t/T) is an unknown deterministic smooth function defined on [0, 1], and it is common to all individuals. The purpose of this article is then to examine the correct specification for g (·) in model (1).
The model given by (1) has wide applications in economics and climate. For example, suppose that y it is the log gross domestic product (GDP) for province i at time t in China, α i is the unobserved province-specific effect, g t represents a business cycle trend, and u it is the province-specific error. The second example is that y it is the log food consumer price index (CPI) for city i at time t in Australia, α i is the city-specific term, g t is the common time trend in the log food CPI, and u it is the city-specific error. A third example is that y it is the total rainfall or temperature in the United Kingdom, α i is the unobserved region-specific effect, g t represents the common climate change trend, and u it is the region-specific error.
The classical panel models often assume iid disturbances. This assumption is likely to be violated as the dynamic effect of exogenous shocks to the dependent variable is often distributed over several time periods. In addition, spillover effects, competition, and global shocks all can induce disturbances that display cross-sectional dependence; see Inoue and Solon (2006), Born and Breitung (2016), Baltagi, Song, and Koh (2003) and Baltagi, Feng, and Kao (2012) for more discussions. To allow for y it to be general enough to accommodate both cross-sectional and serial dependence, we assume u it to follow an AR p process where A (L) = 1 − p j=1 ρ j L j (with p ≥ 1 a fixed integer and L the lag operator) has all roots strictly outside the unit circle. Here, we assume that the dynamic structure of u it is homogeneous across units, and consider the situation where both the cross-sectional sample size, N, and the length of the time series, T, are large. The homogeneous panel autoregressive models are widely used to capture the dynamics of macroeconomic and financial variables, see, for example, Alvarez and Arellano (2003), Hayakawa (2009), andLee, Okui, andShintani (2018). However, the innovations in those articles are only iid over time and across individuals. In this article, the innovation ε it is assumed to follow an MDS such that E (ε it |F t−1 ) = 0 a.s. for each i and to allow for cross-sectional dependence and heteroscedasticity, where F t−1 is the information set available at time t − 1. Moreover, the cross-sectional dependence and heteroscedasticity can be time-varying.
Under (1) and (2), y it is a stable autoregressive process around the deterministic time trend g t = g(τ t ), where τ t = t/T is used throughout the rest of the article. In practice, the deterministic trend function g t is often assumed to take the following parametric form where f t = f (τ t ) is a d × 1 vector of known deterministic trends, θ is a d×1 vector of unknown coefficients, B represents the transpose of a vector or a matrix B. Leading cases for g t include a constant trend f t = 1, a linear trend f t = (1, τ t ) , and a quadratic trend f t = 1, τ t , τ 2 t . In this article we are interested in testing whether or not the postulated parametric trend function f t θ is correctly specified for g t . Therefore, the null hypothesis of interest is while the alternative hypothesis is the negation of H 0 ; namely, where ⊂ R d is the compact and convex parameter space. Note that the deterministic trend g t of the panel data model is well captured by the parametric model f t θ under H 0 , while f t θ is not sufficient enough to describe g t under H A . In particular, to study the local power properties of our proposed test, in Section 3.2 we consider two classes of local alternatives that converge to the null at different rates. Remark 1. It is possible to extend the testing procedure proposed in this article to test the null hypothesis that the trend function g t = g(τ t ) belongs to some general parametric family f (τ t , θ) provided a √ NT-consistent estimator for θ is available; that is, H 0 : g(τ t ) = f (τ t , θ), where θ ∈ R d is an unknown parameter vector and the function f (τ t , θ) : [0, 1] × R d → R has a known prespecified form. Here, f (τ t , θ) is not necessarily a polynomial function of τ t as discussed before.
Remark 2. Our model not only can represent local and "small" trending behaviors of economic and financial variables, but also can capture the global trends. For example, under the null, our model covers a commonly used trending function of the following form where Recently, Gao, Linton, and Peng (2020) consider a semiparametric model with both a parametric global trend and a nonparametric local trend. It is possible to extend our testing procedure to their context with some proper modifications.
Remark 3. Our model (1) can be rewritten as y it = γ it f t + u it , where γ it = α i + g t and f t = 1. In this case, model (1) has a similar representation as Su and Wang (2017), in which they also provide a consistent test for structural changes in factor loadings that includes testing for constant trend as a special case. However, their test is generally not recommended to test for the constant trend of our model. The first reason is that the common factor f t in their statistic is taken to be latent and random, which may bring extra estimated noises into the test. In contrast, our statistic explicitly exploits the information that f t = 1 under the null of constant trend. The second reason is that their statistic is constructed under the MDS assumption on error components, hence, ruling out serial dependence. In contrast, our testing procedure is general enough to allow for time-varying variances, cross-sectional and serial dependence in the error components.
Remark 4. Our model (1)-(2) can be reformulated as which can be further rewritten as where α * i = 1 − p j=1 ρ j α i and g * t = 1 − p j=1 ρ j g t by using g t−j ≈ g t for 1 ≤ j ≤ p if g t is a smooth function (see Assumption 5). This also implies that our model is equivalent to a nonparametric trending panel AR(p) model with fixed effects. As a result, our testing procedure can help check whether the deterministic trend functions of dynamic panel models follow given parametric forms. Without the presence of trends in (7) (i.e., g * t = 0), Hahn and Kuersteiner (2002)  under the alternative asymptotics with 0 < lim N/T = c < ∞, and develop an estimator free of asymptotic bias. Interestingly, we find in Theorem 1 of Section 3.1 that our OLS estimator for {ρ j } p j=1 shares the same convergence rate even in the presence of unknown trends with Hahn and Kuersteiner's (2002) OLS estimator.

The Testing Procedure
In this section we introduce a U-statistic for testing H 0 against Intuitively, the residualû it contains no useful information under the null when f t θ is correctly specified for g t ; it does otherwise. As a result,û it is expected to be close to zero under the null and deviate from zero under the alternative. If the AR p autoregressive coefficients ρ j p j=1 were known, then any deviation from the null can be adequately captured by the deviation of filtered innovation e it from zero, where e it = A (L)û it . With the assistance of e it , we may consider the following U-statistic where k s,t = k((τ s − τ t )/h) with k(·) a kernel function and h a bandwidth parameter. If the null is true, J NT should be close to zero. Under the alternative, J NT will be distant away from zero. Consequently, the adequacy of the parametric trend function f t θ can be rejected when J NT takes overly large value. Although our proposed test shares a similar U-statistic form with that of Lin, Li, and Sun (2014), there exist fundamental differences between the two tests. Firstly, note that in J NT the kernel function k(·) depends on the nonstochastic term τ t . This is different from the statistic considered in Lin, Li, and Sun (2014), in which k(·) depends on the stochastic regressors. As a result, to obtain the asymptotic distribution of J NT , we have to rely on the martingale central limit theorem (CLT) by Brown (1971, Theorem 2) instead of applying Hall's (1984) CLT for a second-order degenerate U-statistic as Lin, Li, and Sun (2014) do. Secondly, the test of Lin, Li, and Sun (2014) is mainly constructed by assuming N → ∞ and keeping T small, hence, the convergence rate of their test is Nh 1/2 , while our test is mainly constructed by assuming T → ∞ and also allowing N → ∞. As a result, the convergence rate of ours is NTh 1/2 . Last but not least, the test of Lin, Li, and Sun (2014) assumes that the error terms are homoscedastic and independent across the units, hence, ruling out heteroscedasticity and cross-sectional dependence.
In the time series context, Juhl andXiao (2005, 2013) and Xiao (2018a, 2018b) have employed similar U-statistic tests to check the stability of parametric models over time. More recently, Casas et al. (2021) have proposed a similar U-statistic to test the constancy of the coefficient functions in a panel data model for nonstationary variables with interactive fixed effects and the MDS innovations. Our proposed test can be regarded as an important extension to diagnose trend specifications in the context of nonparametric trending panel data. A key assumption in these types of tests is that ε it is an MDS over time. Thus, it is important to consistently estimate the nuisance parameters ρ j p j=1 under both the null and the alternative so that we can remove effectively the serial correlation in u it and thus, recover a trustworthy estimate of ε it .
Because u it is unobservable, it is tempting to estimate ρ j p j=1 by simply using the FE residualû it obtained under the null. However, the potential misspecification in g t under the alternative may lead to inconsistent estimation of ρ j p j=1 and consequently cause testing power loss of the proposed statistic. It is thus, crucial to use a robust estimator that can approximate ρ j p j=1 accurately under both the null and the alternative. As such, we estimate g t using the conventional local linear approach and then estimate ρ j p j=1 based on the resulting nonparametric residual. Following Li, Chen, and Gao (2011) and using the identification condition N i=1 α i = 0, we define the average local linear estimator where l s,t = l((τ s − τ t )/b) and M s,t = (1, (τ s − τ t )/b) with l(·) a kernel function and b a bandwidth parameter. Leṫ u it = y it − y iA −ĝ t + y AA be the nonparametric residual and consider the feasible Then the OLS estimator for ρ p is given bŷ As shown in Theorem 1 in Section 3.1,ρ p is a consistent estimator for ρ p under both the null and the alternative.
With the help of ρ j p j=1 , the feasible U-statistic corresponding to (9) is given bŷ Once again, if the null is true,Ĵ NT should be close to zero, while under the alternative, it will tend to a positive value. The distinct behaviors ofĴ NT under the null and the alternative form the basis of our testing procedure.

Asymptotic Results
In what follows we first show thatρ p in (11) is a consistent estimator for ρ p under both the null and the alternative. We then establish the asymptotically normal distribution ofĴ NT under the null. We proceed to study its asymptotic power properties under the alternative and two classes of local alternatives that converge to the null at different rates. Finally, we provide a bootstrap method and justify its validity.

Asymptotic Null Distribution
For establishing the consistency of the estimatorρ p in (11), we need the following assumptions. (1) and (2) Assumption 1 rules out conditional heteroscedasticity that depends on the past information at time t − 1. However, it does allow for unconditional heteroscedasticity that depends on cross-sectional units and the scaled time index τ t and is therefore, less restrictive than conditional homoscedasticity. The degree of cross-sectional dependence is controlled by the two moment conditions is the cross-sectional correlation. This implies that the time-varying features of ω ij (τ t ) may originate from the cross-sectional correlation λ ij (τ t ), or the unconditional heteroscedasticity ω ii (τ t ) and ω jj (τ t ) or both. We note that unconditional heteroscedasticity is widely adopted in time series models with time-varying variances. Alternatively, one could allow for conditional heteroscedasticity by introducing suitable mixing conditions, but this would result in a substantial complication of the proofs. In order to demonstrate that our proposed test is robust to the presence of conditional heteroscedasticity, we consider some simulation experiments with GARCH effects in the Appendix B, supplementary materials, and leave the theoretical investigation of trending panel data models with conditional heteroscedasticity as future work.
Assumption 2(i) indicates that (2) has a causal MA(∞) Considering the cases in which u it is an integrated process is beyond the scope of this article. Assumption 2(ii) implies that y it is generated by a nonparametric trending panel data model with fixed effects, in which unconditional heteroscedasticity, cross-sectional and serial dependence are allowed. Note that the identification condition (8) under the null. This restriction is only used to help obtainĝ t in (10) under the alternative.
Assumptions 3 and 4 are standard assumptions on kernel function and bandwidth parameter in nonparametric literature of trending panel data models.
Assumption 5 imposes certain smoothness condition on the trend function g(·) and covers both the null and the alternative. This condition is not overly restrictive and is possible to allow for a finite number of breaks in g(·) under the alternative since broken trend functions can be well approximated by certain smooth functions. 3 In the simulation section, we have considered two cases (i.e., DGP.P2 and DGP.P4) where abrupt breaks are allowed in g(·) under the alternative. Our test appears to work satisfactorily for both cases.
For a vector or a matrix B, we denote by B = [tr(BB )] 1/2 the Euclidean norm. We have the following theorem about the consistency ofρ p regardless of whether or not the null holds.
Theorem 1. Suppose that Assumptions 1-5 hold. Then, as T → ∞ and N → ∞, Theorem 1 shows that the estimatorρ p is consistent under both the null and the alternative without knowing the exact form of the trend function g t . In this way, we can remove the serial correlation in u it and recover a consistent estimate of ε it in our testing procedure. Of course, the assumptions of the theorem require that the trend function g t satisfies certain smoothness properties. Note that the estimation of AR parameters ρ p in conventional time series settings converges at the √ T rate. By incorporating cross-sectional information, our dynamic structure can deliver a more precise estimator for ρ p with its convergence rate √ NT for N ≤ T and T for N > T. That is, thanks to the use of panel data with large N and T, we are able to obtain an estimator for ρ with a much faster convergence rate. In Theorem 1 we do not explore the asymptotic distribution of ρ p and only provide its convergence rate, which is sufficient for our purpose.
Remark 5. The lag length p in (2) is a fixed integer, and is required to be determined in practice. It is well known that the lag length selected by traditional information criteria such as BIC is inconsistent in the presence of nuisance parameters. Han, Phillips, and Sul (2017) prove that BIC is inconsistent in dynamic panel models even without fixed effects, and then propose two modified BIC (MBIC) methods that work consistently. Andrews and Lu (2001) also introduce consistent model and moment selection criteria (MMSC) to help select the correct lag length in dynamic panels. However, the MBIC and MMSC methods are constructed under the assumption of iid innovations, and may be invalid in the presence of time-varying variances and cross-sectional dependence in error components. 4 Similarly, the general-to-specific testing procedure proposed by Lee, Okui, and Shintani (2018) who suggests testing for the significance of the coefficients on lags cannot work here due to the presence of time-varying variances and cross-sectional dependence. Hence, we suggest employing the sample autocorrelation function (SACF) and the sample partial autocorrelation function (SPACF) to help determine the lag length p. In order to avoid potential misspecification of lag choice, we can also try several lag lengths that are most likely to be selected by SACF and SPACF.
Remark 6. Note that any stationary and invertible ARMA process can be expressed as an AR(∞) process. In order to accommodate the ARMA process, we can extend u it to be an AR(∞) satisfies the stationarity condition. Following AR sieve estimation of dynamic panels in Lee, Okui, and Shintani (2018), we then approximate the AR(∞) process by a truncated AR(p) model if the truncation parameter p goes to infinity at an appropriate rate as T → ∞ and N → ∞. It is expected that the AR sieve estimators are still consistent under both the null and the alternative, but have a slower convergence rate than min √ NT, T , the rate of the estimatorρ p in Theorem 1. This is because there are p coefficients to be estimated, and p also goes to infinity as T → ∞ and N → ∞. Under some appropriate assumptions on p and ρ j ∞ j=1 , we conjecture that the main theoretical results of J NT will not change; see Wu and Xiao (2018a). We leave this for future research.
Before presenting the asymptotic distribution of the test statistic in (12), we need to add the following assumptions.  Assumption 8 is similar to the assumption used in Vogelsang (1998) and Juhl and Xiao (2005), and is general enough to permit various kinds of deterministic trend specifications. Similar to Assumption 5, the smoothness condition in Assumption 8 is used to ensure the nuisance parameters ρ j p j=1 can be consistently estimated without knowing the form of g (·) in advance. Assumption 9 allows the cross-sectional covariance and variance to exhibit a single break or multiple structural breaks, or smooth structural changes over time.
The following theorem formally establishes the asymptotic normality ofĴ NT when the null is satisfied.
Theorem 2. Suppose that Assumptions 1-9 hold. Then, under H 0 : g t = f t θ , as N → ∞ and T → ∞, where N(0, ϕ 2 ) is a normal distribution with zero mean and variance

Asymptotic Power
We proceed to investigate the asymptotic power ofĴ NT under the alternative and two classes of local alternatives that converge to the null at different rates. We first consider the power ofĴ NT under the alternative H A : g t = f t θ that satisfies Assumptions 5 and 8. The consistency property of the test rejecting H 0 for large values ofĴ NT is stated in the following theorem.
Theorem 3. Suppose that Assumptions 1-9 hold. Then, for any nonstochastic sequence C NT = o(NTh 1/2 ), as N → ∞ and T → ∞, Remark 7. Theorem 3 shows that, under H A , the test statis-ticĴ NT diverges to positive infinity at the nonparametric rate NTh 1/2 . This implies that the proposed test is a one-sided test, and is consistent against any fixed alternative.
In order to study the local power ofĴ NT , the next theorem establishes its asymptotic distributions under two sequences of local alternatives converging to the null at different rates; namely, H 1 LA and H 2 LA given by (13) and (14). Case I: Local smooth alternatives where π(·) : [0, 1] → R is a twice continuously differentiable function that is generally unknown. The term j NT π(τ t ) characterizes the degree of departure of the smoothly changing trend function g t from the null hypothesis f t θ at time t. Specifically, π (τ t ) denotes the direction of departure, while j NT = j (N, T) → 0 is the speed at which the departure of g t from f t θ at each time point t vanishes to zero as N → ∞ and T → ∞. Case II: Local sharp alternatives at some point τ * where τ * is a given point in [0, 1], ψ (·) is a twice continuously differentiable function that is generally unknown and satisfies sup z∈R |ψ (z)| < C and sup z∈R ψ (z) < C with ψ (z) the second derivative of ψ (z), d NT = d (N, T) → 0 and r NT = r (N, T) → 0 as N → ∞ and T → ∞. This type of alternatives is also considered in Chen and Hong (2012) and Chen and Huang (2018) in different contexts, and, in contrast to the local smooth alternatives, can be regarded as a type of high frequency local alternatives. Under H 2 LA , the trend function g t becomes a nonsmooth spike at location τ * as N → ∞ and T → ∞, due to the shrinking width parameter r NT . Here r NT controls the sharpness of the deviation from the null around τ * , while d NT is the speed at which the departure of g t from f t θ at each time point t vanishes to zero.

Theorem 4. Suppose that Assumptions 1-9 hold. (i) Under
Clearly, when π(τ t ) = 0 in Case (i) or ψ(z) = 0 in Case (ii), Theorem 4 reduces to Theorem 2 when the null is true. In Theorem 4, the "noncentrality parameters" δ 1 and δ 2 represent the shifts in charge of asymptotic local powers against alternatives H 1 LA and H 2 LA , respectively. Note that δ 1 = 0 if π(τ t ) = f t ζ for some nonzero vector ζ . Therefore, for directions π(τ t ) that are not collinear with f t , δ 1 is nontrivial. In this case, Theorem 4(i) means thatĴ NT has a nontrivial asymptotic power against H 1 LA that diverges from the null at a rate of (NT) −1/2 h −1/4 . On the other hand, under H 2 LA , as long as ψ (z) is a nonzero function, δ 2 is nontrivial. By choosing suitable sequences of r NT and d NT , Theorem 4(ii) implies thatĴ NT may have good asymptotic power in detecting against broken trends since the local nonsmooth and sharp spikes under H 2 LA are similar to jumps or nonpersistent temporal breaks. It is worth noting that both δ 1 and δ 2 depend on the serial dependence structure in u it as indicated by A(1) = 1 − p j=1 ρ j . As a result, A(1) will affect the testing power ofĴ NT .
Finally, we note that following Gao and Gijbels (2008), it is possible to estimate π(·) in H 1 LA or ψ(·) in H 2 LA , which is relevant to the practical computation and implementation of the asymptotic normality established in Theorem 4.

A Bootstrap Method
The test statisticĴ NT has an asymptotically normal distribution under the null hypothesis. However, it is well known that kernelbased nonparametric tests often suffer from size distortions in small or moderate samples. For this reason, in this section, we propose to use a residual-based wild bootstrap method to better approximate the finite sample distribution ofĴ NT under the null, which serves as a useful alternative to the normal asymptotic method.
Our wild bootstrap method, although inspired by Lin, Li, and Sun (2014), is new and more involved. In the following, we give the steps of computing bootstrap test statistic.
The starting values for the AR(p) model are given by . Calculate the bootstrap p-value p * = B −1 B j=1 1 Ĵ * NT,j >Ĵ NT . The null hypothesis will be rejected whenever p * is smaller than the given significance level.
Let d −→ * denote the convergence in distribution under the bootstrap law, that is, conditional on the sample Y NT . The following theorem justifies theoretically the validity of the proposed bootstrap method.
Theorem 5. Suppose that Assumptions 1-9 hold. Under the null, as N → ∞ and T → ∞, we havê Theorem 5 shows that the bootstrapped test statisticĴ * NT converges in distribution to the same normal distribution N (0, ϕ 2 ) ofĴ NT established by Theorem 2. Therefore, Theorem 5 implies that if the null hypothesis is satisfied the proposed bootstrap method provides an asymptotically correct approximation to the limiting null distribution of test statisticĴ NT .

Simulations
Section 4.1 discusses how to select bandwidths b (for estimation) and h (for testing) in the test statisticĴ NT . Section 4.2 then conducts a set of simulations to assess its finite sample performance.

Bandwidth Selection
The local linear estimatorĝ t in (10) requires to select the bandwidth b. Define ν 0 = 1 −1 l 2 (u)du and μ 2 = 1 −1 u 2 l(u)du, then the asymptotic mean integrated square error (AMISE) ofĝ t is where g (·) is the second derivative of g(·). By minimizing the AMISE, we obtain the optimal bandwidth However, the above bandwidth cannot be used directly as A(1), σ 2 ε (·) and g (·) in (15) are clearly unknown and their estimation would involve additional complex quantities.
In what follows, we consider the method of "leave-one-out" cross-validation (CV). Formally, a data-driven choice of b is given by whereĝ t,−1 is the leave-one-out estimator, that is,ĝ t,−1 is the same asĝ t except that the summation in (10) is taken for s = t, and c 1 and c 2 are two prespecified positive constants. The test statisticĴ NT involves the selection of the second bandwidth h. In finite samples, the filtered residualε it under the null contains the noises of estimating ρ j p j=1 . As a result,Ĵ NT is affected by the estimator ρ j p j=1 for ρ j p j=1 . Juhl and Xiao (2013) propose an AR(1)-based plug-in method to select the bandwidth parameter when they consider testing for moment condition instability by using a similar U-statistic test. Such a plug-in method provides a simple and effective solution to the data-driven bandwidth choice. Here we follow Juhl and Xiao (2013), and adopt an AR(p)-based plug-in bandwidth given by since the second bandwidth h only depends on T by Assumption 7. Here c is a correction parameter.

Simulation Results
The theoretical results of Sections 3.1 and 3.2 give conditions under which the proposed test statisticĴ NT will be well-behaved in terms of its limiting distribution under the null and its power under the alternative in large samples. In this section, we conduct a series of Monte Carlo experiments to investigate the finite sample performance ofĴ NT . In particular, the results of J NT implemented through the residual-based wild bootstrap method suggested in Section 3.3 are reported.
As to the selection of bandwidth b, we make use of the CV method described in (16) and set the bandwidth to b = 1.05 j−15 (NT) −1/5 , where 1 ≤ j ≤ 30, implying that c 1 = 0.5051 and c 2 = 2.0789 in (16). For the bandwidth h, we make use of the AR(p)-based plug-in bandwidth given by (17), and specify the correction parameter c = 0.75. For the univariate kernels used in the nonparametric estimation of trend function and in the calculation ofĴ NT , we choose the Epanechnikov kernel l(v) = k(v) = 0.75 1 − v 2 1 (|v| ≤ 1). We generate 1000 datasets of panel observations y it , i = 1, . . . , N, t = 1, . . . , T with cross-sectional sample size N = 15, 30, 50 and length of time series T = 15, 30, 50, and employ B = 399 bootstrap iterations for each simulated dataset. The sequence of η t in the wild bootstrap is set to Mammen's (1993) two-point distribution: In addition, our experiments focus on the nominal level of 5%. First, to investigate the size performance of our test under the null, we consider the following data generating process, denoted by DGP.S, where we fix the individual effects α i by first generating α 1 , . . . , α N−1 independently from the standard normal distribution, then taking α N = − N−1 i=1 α i and keeping these α i fixed across replications. The error term u it is assumed to follow an AR(1) process by letting ρ take 0, 0.4, and 0.7. Let ε t = (ε 1t , ε 2t , . . . , ε Nt ) , which is generated as a sequence of an N-dimensional vector of independent normal random variables with zero mean and constant covariance matrix ω ij N×N over time where ω ij = λ |i−j| and λ takes λ 1 = 0 or λ 2 = 0.5. From Table 1. Empirical sizes of the proposed test under the null hypothesis.  the way ε it is generated, it is easy to see that E ε it ε js = 0 for t = s, and E ε it ε js = λ |i−j| for t = s. Two cases of interest under the null are considered here. In the first case we set g (τ t ) = 0 and test for the constant trend; in the second case we set g (τ t ) = 1 + τ t and test for the linear trend. Table 1 reports the rejection rates ofĴ NT under DGP.S at the 5% significance level when the cross-sectional covariance ω ij N×N is constant, using bootstrap critical values. For testing g (τ t ) = θ 0 , we find that, the estimated sizes are reasonably close to the nominal level for all sample sizes considered and for all cases of λ (λ 1 = 0, λ 2 = 0.5) and ρ (ρ = 0, 0.4, 0.7), which suggest that our test statisticĴ NT is robust to both cross-sectional and serial dependence. For testing g (τ t ) = θ 0 + θ 1 τ t , the size performance is similar to that of testing g (τ t ) = θ 0 . Thus, the bootstrap indeed approximates the finite sample distribution of J NT well under the null hypothesis.
In order to show that our proposed test is robust to timevarying cross-sectional covariance matrix ω ij (τ t ) N×N , we let where κ (τ t ) and λ (τ t ) |i−j| represent, respectively, the common unconditional heteroscedasticity and the cross-sectional correlation that are possibly timevarying. In particular, we let κ (τ t ) = 1 + 4τ 2 t , and consider two different specifications for λ (τ t ) here: λ 2 = 0.5 and In the first case we allow κ (τ t ) to exhibit smooth transition from 1 to 5, but keep λ (τ t ) constant over time, while in the second case, we allow λ (τ t ) to exhibit one abrupt break from 0.5 to 0.2 at the midpoint of time. Table 1 shows that the estimated sizes ofĴ NT with time varying ω ij (τ t ) N×N are fairly good, and enjoy similar patterns to those ofĴ NT with the constant ω ij N×N , which in turn impliesĴ NT is also robust to time-varying unconditional heteroscedasticity and time-varying cross-sectional correlation.
To investigate the testing powers ofĴ NT , we consider four alternative specifications for g(τ t ): DGP.P4-Broken linear trend: For each of DGP.P1-P4, we specify γ = 1. DGP.P1 and DGP.P2 are tested under the null of constant trend g (τ t ) = θ 0 , in which g(τ t ) evolves as a quadratic trend and a broken trend with one breakpoint, respectively; and DGP.P3 and DGP.P4 are tested under the null of linear trend g (τ t ) = θ 0 + θ 1 τ t , in which g(τ t ) follows a quartic trend and a broken linear trend with two breakpoints, respectively. We first explore the testing powers under constant cross-sectional correlation λ 1 = 0 and λ 2 = 0.5. Tables 2 and 3 report the rejection rates ofĴ NT with bootstrap critical values under DGP.P1-P4 at 5% significance level. Generally speaking, the test statisticĴ NT has good allaround powers against the four alternative specifications. We also find that the testing powers ofĴ NT under DGP.P1-P4 look similar, and they tend to increase as either N or T increases, but to deteriorate as either λ or ρ increases. This also confirms the findings in Theorem 4 that bigger cross-sectional correlation λ or stronger autocorrelation ρ will reduce the testing powers of J NT .
In order to explore the testing powers ofĴ NT in the presence of time-varying cross-sectional covariance matrix, we still consider the same specifications for ω ij (τ t ) = κ (τ t ) λ (τ t ) |i−j| as before, where κ (τ t ) = 1 + 4τ 2 t , λ 2 = 0.5 and λ 3 = 0.5 0.2 τ t ≤ 0.5 τ t > 0.5 . Although the time-varying specifications of ω ij (τ t ) do not affect the testing sizes, they have substantial impacts on the testing powers ofĴ NT , which can be found by comparing the currently estimated powers with those of  constant ω ij in Tables 2 and 3. Especially increasing the heteroscedasticity from var(ε it ) = 1 to var(ε it ) = 1 + 4τ 2 t reduces the testing powers ofĴ NT as it alters the relative magnitude of the deviation from the null with respect to the variance.
To confirm that our proposed test exhibits good power when the deviations from the null are increased, we treat the empirical powers of the testĴ NT as a function of γ . For simplicity, we only consider ρ = 0.4 and keep all other parameters unchanged as in power experiments for DGP.P1-P4. We set (N, T) = (30, 30), and make 1000 replications. Similarly, we still consider the four different specifications for the cross-sectional covariance ω ij (τ t ) as before. When γ = 0, we are back to the null hypothesis. Figure 1 shows that the power functions for different ω ij (τ t ) all increase monotonically as γ gradually increases. When the magnitude of γ increases to a larger extent, all the testing powers ofĴ NT tend to unity. But the rates of reaching unity are negatively affected by ω ij (τ t ), which once again confirms the theoretical results in Theorem 4.
Finally, to investigate whether our test statisticĴ NT is robust to the presence of GARCH effects, we consider two GARCH(1,1) processes with different degrees of persistence in the Appendix B, supplementary materials. We find that the estimated sizes for testing g (τ t ) = θ 0 and g (τ t ) = θ 0 + θ 1 τ t are fairly close to the nominal level for different values of ρ and λ, as well as for the different persistence in GARCH volatilities, especially when either T or N is moderately large. Similarly, we also report the testing powers ofĴ NT against the four alternatives DGP.P1-P4 in the presence of GARCH effects in the Appendix B, supplementary materials. We find that the power performance is satisfactory and larger T or N yields higher power. As before, the testing power decreases as either λ or ρ increases. On the other hand, in contrast with the important role played by the cross-sectional dependence λ and autocorrelation ρ, the degree of persistence in GARCH volatilities does not seem to affect the testing powers very much and the test statistiĉ J NT performs similarly for the different volatility persistence.
To sum up, our simulation results suggest that even with relatively small sample sizes the proposed testĴ NT implemented through the residual-based wild bootstrap exhibits fairly good size accuracy. Of course, the test also shows all-around good powers against various misspecifications in the trend functions, which confirms the consistency property of the testĴ NT against various alternatives. In addition, our testĴ NT is quite robust to the presence of GARCH-type conditional heteroscedasticity in the error components.

An Empirical Application: Trends in the U.S. Income Data
In this section, we consider an empirical application. Specifically, we study the common trends feature in the per capita personal income (PCPI) data across 51 states of United States by applying our proposed test to examine the postulated specifications of the common trends. The PCPI data are taken from the Bureau of Economic Analysis, U.S. Department of Commerce, and are annual, spanning from a 46-year (1970-2015) period. Hence, N = 51 and T = 46 in our notation. Following the convention, we take log of the data and focus on ln PCPI. Visual inspection of Figure 2(a) suggests that ln PCPI may share upward common trends, which motivates us to consider the following panel data trending regression model where i = 1, . . . , 51, t = 1, . . . , 46, α i 's are the individualspecific effects, g t = g (τ t ) is an unknown function for the common trends, and u it follows an AR(p) process given by (2).
In what follows, we consider the question of whether the usually adopted polynomial (in particular, linear or quadratic) specifications of the common trends are supported over the time period considered. This might have potential implications for studying the income dynamics of the U.S. labor market. Specifically, we are interested in testing for the correct parametric specification for g (τ t ). 6 It is reasonable to first test for the null hypothesis of linear common trends g(τ t ) = θ 0 + θ 1 τ t . In order to apply the testing procedure developed above to assess the fit of the linear trend, we also need to determine the lag length p. Toward this end, based on the nonparametric residual u it = y it − y iA −ĝ t + y AA , whereĝ t is given by (10), we examine the SACF and SPACF for each state i. The results reveal that at the 5% significance level, all SACFs die off exponentially, and most SPACFs cut off at lag one except that several of them are up to lag four. In order to avoid potential misspecification of lag length and to assess the sensitivity of the test to its choice, in the following we let p take 1, 2, 3, and 4 in our proposed test.
To implement the testĴ NT , we follow the same procedure as described in the Monte Carlo simulation section, except that we specify the number of bootstrap replications B = 10,000. It is clear from the second row of Table 4 that all the bootstrap pvalues forĴ NT are zero for all the lag lengths that are used to filter out the serial correlation in the error term. It is also clear that the bootstrap p-values are not sensitive to the choice of  AR (1) AR (2) AR (3) AR (4) H 0 : g t = θ 0 +θ 1 τ t 0.0000 0.0000 0.0000 0.0000 H 0 : g t = θ 0 +θ 1 τ t +θ 2 τ 2 t 0.4975 0.4120 0.3923 0.5867 lag length. As a result, we can reject the null hypothesis of linear common trends at any conventional significance levels and conclude that linear trend provides a very poor fit for the PCPI data.
To consider the possibility of a nonlinear trend, we test for the null hypothesis of quadratic common trends g(τ t ) = θ 0 + θ 1 τ t + θ 2 τ t 2 . The last row of Table 4 shows that the quadratic trend specification cannot be rejected even at the 10% significant level for all the lag lengths and the bootstrap p-values are not apparently sensitive to the lag length. To further confirm the adequacy of quadratic relationship, we also estimate the trend function using both quadratic and nonparametric specifications. The linear and quadratic fits as well as the nonparametric fit using the CV bandwidth are shown in Figure 2(b). There are two appealing features to note about the estimated trend functions. While the linear fit is obviously far from the nonparametric one, the quadratic fit coincides almost exactly with the nonparametrically estimated trend function. From both the testing results in Table 4 and the comparisons among the three fits in Figure 2(b), we can conclude that quadratic trend provides a better fit for the ln PCPI data, with the fitted quadratic curve given byĝ (τ t ) = 8.2188 + 4.3026τ t − 1.8126τ 2 t .
Our findings in this section shed new light on the possible theories that aim to explain the U.S. income dynamics, in which the quadratic (hence, nonlinear) specification should be preferable to the linear specification.

Conclusions
In this article, we propose a nonparametric test for the trend specifications of panel models with fixed effects. Compared with the existing specification tests for panel models, our proposed test is intuitively appealing and straightforward to compute. It has a simple asymptotically normal distribution under the null, and requires no prior information on the possible alternatives, what it requires is the transformed residuals of the null. The test is consistent against various forms of alternatives that deviate from the null, and is robust to heteroscedasticity, cross-sectional and serial dependence in the error components. Moreover, only mild conditions are imposed on N and T, hence, our test can allow for various size combinations of N and T. To reduce size distortions in the nonparametric test in finite sample applications, we propose using a wild bootstrap method to improve the finite sample performance of our test statistic. Monte Carlo simulations indicate that our proposed test implemented with bootstrap p-values has both reasonable sizes and all-around good powers in finite samples. An empirical example concerning the specification of the common trends in the U.S. per capita personal income data also illustrates the usefulness of our testing approach in real datasets. Some extensions are possible. First, based on the local linear dummy variable estimation method [see, e.g., Chen, Gao, and Li (2012)], testing the null hypothesis of correct trend specification in the nonparametric trending panel data model can be extended to the semiparametric trending panel data model that includes regressors. Second, although the proposed test is developed for diagnosing panel trend specifications, it can be extended to detect parameter instability in either static or dynamic panel models. Of course, we can also extend the approach to detecting threshold effects in quantile panel regressions. In addition, how to choose the bandwidth to maximize our test's power is not yet investigated. An interesting possibility is to follow Gao and Gijbels (2008), who have proposed to use the Edgeworth expansion of the asymptotic distribution of the kernel-based test in order to choose the optimal bandwidth such that the power function of the test is maximized while the size function is controlled. Another question is the determination of optimal lag length in the autoregressive process as a researcher might want to know which lag should be used to deliver the best test in terms of size control and power maximization. These topics are left for future work.

Supplementary Materials
The online supplementary appendix provides the proofs of the theoretical results, along with the results of additional Monte Carlo simulations. Appendix A of this document contains the detailed proofs of the theoretical results developed in Section 3 of the main text. In particular, it contains the proofs of Theorems 1 and 2 in Section 3.1, Theorems 3 and 4 in Section 3.2, and Theorem 5 in Section 3.3. Appendix B of this document contains the tables of some additional simulation results that examine the finite sample performance of the proposed test statisticĴ NT in the presence of GARCH effects in the error components. Therefore, the simulation results presented in Appendix B complement those in Section 4.2 of the main text.