Deductions & credits

@anon42 sounds like you were a PA resident until you moved to VA.   PA was your permanent residence while in grad school.  If you were not a dependent on your parent's tax return, I do not see why MA comes into play.  

 

that may make this easier.