Factor function to assign levels to activity.type