I am trying to remember a movie I saw when I was young

Trying to remember the name of a movie in which the main character slowly realizes that she had such profound grief when her best friend died that she started living as her friend and repressed herself. I saw it on tv in the 70’s so it would be from then or before. The woman keeps having nightmares about her own funeral but finally realizes it was actually her friends funeral but she couldn’t cope with it and started dressing and acting as her friend. She starts having episodes where she acts completely different than usual but eventually realizes it’s her own personality trying to reassert itself. I believe the character finally recalls that her own name is Sandy,