The difference between your GPS and your compass is the sum of variation (difference between magnetic and geographical North) plus deviation (compass "error" caused by ferromagnetic metals on the boat) plus leeway (current plus leeward slippage of the boat through the water). To find deviation from GPS and compass readins you need to know variation and leeway, or to sail in one direction and then reverse course by 180.