The procedure you are using for aggregated data is wrong, because you do not consider explanatory covariates when aggregating the data. Because of that each unique sequence is attributed to an almost random covariate profile, giving wrong results.
What you need to do is aggregating sequence and covariates. Here covariates "Grammar" "funemp" "gcse5eq" are located in columns 10 to 12. So
## Aggregate example data
mvad.agg <- wcAggregateCases(mvad[, c(10:12, 17:86)], weights=mvad$weight)
mvad.agg
We then come to the next problem: permutation test. If you do nothing, you will permute only aggregates (and omit permutations inside aggregates) giving you wrong p-values. Two solutions can be used:
- If you do not have sampling weights use weight.permutation="replicate" telling the procedure to permute inside aggregates using a case unit of one.
- If you have sampling weights, there are no perfect procedure. You can use weight.permutation="random-sampling" (random assignment of covariate profiles to the objects using distributions defined by the weights.)
In all the cases, you may observe small differences of p-values (because you have a different procedure), and also because p-values are estimated using permutation tests. To get more precise p-value try to use an higher R value (number of permutations). In the tree procedure, the minimum p-value to make a split can be changed using the pval
argument. You can try to set it just a little higher to see if the differences come from here.
I hope it helps.