I'm not quite sure what you are trying to calculate, or why, but I think it could be simply allocated as a percentage based on the number of days you spent in Massachusetts.
(Days in MA / 365) X (Amount you paid in 2022 to social security (FICA), railroad, Medicare U.S. Massachusetts retirement)
If I've misunderstood your question, and this does not completely answer it, please contact us again and provide some additional details.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"