What does "でいる" mean?


I've heard the sentence "一人でいるのが好きです", meaning "I like to be alone".

Is this a substitute of "です", could I for example say "学生でいるのが好きです"? If so,
how is it different from "である"?

Thanks in advance.

