# Permutation F test for nested models

How can I do a permutation F test for testing if a larger model which contains a larger model is better? e.g.

Model 1 : y ~ x1 + x2 Model 2 : y ~ x1 + x2 + x3 + x4

H0 : $$\beta_3 = \beta_4 = 0$$ H1 : At least one of $$\beta_3$$ and $$\beta_4$$ is non-zero

I am guessing one way is to permute both columns x3 and x4 independently and then compute the F statistic which gives the distribution of this statistic under the null hypothesis. But is this correct? I came across the package lmPerm in R which lets you do permutation tests for linear models. I would like to know how it does it.