I am currently working on a discrete choice experiment. I have collected all my data and formatted/organized it in excel (see screenshot of my dataset in Rstudio).

I am currently trying to carry out coefficient estimation via the mlogit package. However.. I am not really an R/Rstudio guru so I am having trouble using the right coding.

I have already loaded my excel file into the Rstudio Library, loaded the required packages and formed an mlogit.data set. However.. I am most likely not doing it right as I now keep getting errors. I have also attached a screenshot of the code I entered into Rstudio.

My question now is; looking at my data in excel, have I entered the right code into the mlogit.data function. And what do I enter into the mlogit function. Really hoping someone has experience with this mlogit package and could help me.

I am not familiar with the mlogit package and a quick look at the documentation did not make it clear to me everything you need to do. However, one problem is likely that in your call to mlogit() you have elements of the formula in single quotes. You should use the bare column names instead. The formula definitions in R generally take the bare column names.

Notice that I have added underscores to the column names that include spaces. Though it is possible to have column names with spaces, it is a source of needless trouble and you should just avoid it.
I hope that helps some.

The ultimate goal is to do coefficient estimation once the model is set with the summary function. I have inserted my Rcode below for some clarification

#load data via window to the right
cycleroute <- read_excel("Cycling Route Survey Data - R versie.xlsx")
#mlogit data
cyclemlogit <- mlogit.data(cycleroute, choice = "Choice", shape = "long", alt.var = "Alternative")
#model
cyclemodel <- mlogit(choice ~ Crowding + Congestion + Number_of_Stops + Distance |
Gender + Age + Daily_Distance, data = cyclemlogit)