I am running a reg model with Weekdays as my dummy variables so I can find the weekday effects to the output metric. The picture below shows the results from this regression, and only Sunday is significant. In this case, I usually like to group the Mon, Sat, Thur, Tue & Wed into one group along with the baseline "Friday" as they are all insignificantly different to the base-line Friday (named as "Rest"), and re-run the model with two dummies "Sun" and "Rest". (one of the two will be automatically chosen as the base line by R). I wonder is there some package or method R can do this auto-regrouping and re-run the model by itself till all grouped dummy groups are significant.
thank you.
R
question--it clearly is asking forR
code--so it's sure to get close votes. But there's an important statistical question beneath it related to the inadvisability of abusing p-values in this way. It seems likely this procedure is going to be used inappropriately to determine some "optimal" way to group the days. Consider addressing that issue before you use this procedure. $\endgroup$