What can cause swelling on the base of the head on the right side with a raisin size knot located in the middle of the swelling?

Probably lymph node. Do you have any abnormality in the scalp, even a bad case of dandruff? What you described sounds like result of some inflammation in the scalp and enlarged draining lymph node. Pay attention to scalp hygiene and if it does not resolve in 4-6 weeks, or if it becomes painful, or starts draining, see your doctor.