It also depends where your friend is living. Presumably they aren't staying on campus, so are someplace in the city (i'm guessing not Pollock Halls). The between city options are as stut describes; if you can give more info about where you'll be in Edinburgh, we can advise on within city info.
Also, be aware that University of Stirling is an out of town campus. I don't know what the transport options are at that end, but the university will likely have that info if no-one on here can help.