Although I agree that often the spelling of names isn't always consistent in this time period, the name, whatever it is, just doesn't look long enough to be interpreted as Hamilton.
Also I don't think we can conclude that just because the person is from Allanshaw that it necessarily has to be a Hamilton. There may be other families from Allanshaw, or the Hamilton's might have tenant farmers or servant families working for them. They could all legitimately claim to be from Allanshaw.