Imaginary current
It looks like you are taking the imaginary of the voltage, not the current...
If Vtest is the current, then you can't take the imaginary of it before dividing it by the voltage. You must take the current and divide it by the voltage waveform first, and then extract the imaginary resistance and real resistance. Taking the imaginary of the current doesn't make any sense since phase is only relevant relative to something (i.e. relative to the voltage applied).
Greg