Neweywest test in R Portfolio analysis is being conducted using R.
We use the neweywest function belonging to the sandwich package, and the brief description is as follows.
j <- lm(Y ~ 1)    
coeftest(j, vcov.=neweywest (j, adjust=T, prewhite=F))

How do I apply lag in neweywest test?
There are five portfolios in the same time series and each portfolio contains 200 months of data.
According to the rule of thumb, m=0.75*T^(1/3), so m is 4.38, and if floor is applied, it is 4. That is, since lag=m-1, is it right to apply lag=3?
Or do I have to apply lag = 0?
Is it the same when the regression coefficient by Fama-Macbeth cross-sectional regression analysis is expressed as neweywest-test?

The lag in NeweyWest() (and also in kernHAC()) is selected automatically by default. Note that both of these do not apply simple rules of thumb but the procedures by Newey & West (1994, Review of Economic Studies) and Andrews (1991, Econometrica), respectively. So you don't have to do this manually unless you believe that the methods above do not work appropriately in your setting. For more details see:

*

*?NeweyWest

*?kernHAC

*vignette("sandwich", package = "sandwich")
