1
$\begingroup$

I'm playing with the Titanic data set, and trying to figure out what to do about the results I got from a lm that predict the age of the passenger.

Here are my results

How should I handle the Cabin values? Some Cabin levels are significant, while others aren't -- but they're all under the same 'Cabin' column.

So if I want to predict the age of a passenger, should I omit the cabin levels that aren't significant? What's best practice here?

Thanks!

$\endgroup$
  • $\begingroup$ I dont think CabinA10 is a feature in Titanic Dataset. Did you encode the data? $\endgroup$ – Justice_Lords Mar 14 '19 at 16:31
  • $\begingroup$ You used treatment contrasts; that means p-values in the summery table are a comparison against a reference cabin value. I expect there is still a significant difference between cabin 10 and cabin 16. Just looking at the p-values, you should use the model as is (including all cabins) for prediction. However, if your goal is prediction, you should based such decisions not on p-values but on cross-validation (and then validate the final method with a test data set). $\endgroup$ – Roland Mar 15 '19 at 10:21
1
$\begingroup$

The most insightful way would be, the way I see it, to report all of the 'Cabin' levels. The 'Cabin' variable results in significant results to some degree, so it would be worth mentioning. Only including the significant levels can possibly be misleading. Readers of your reports might raise questions as to why the remaining (insignificant) levels aren't included. Transparency and complete reporting seems key here.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Apart from following @Mathijs advice, I will run again the regression with CabinA23 as a dummy variarable where 1 means factor CabinA23 and 0 any other. If it is still significative (It should be), you can see that being in CabinA23 had a XX Estimate effect on your model. Best!

| cite | improve this answer | |
$\endgroup$