Having problem with marginal effect in nested logit using R package mlogit

#1
I am having a problem estimating the marginal effect using the "effects" command and also the modified m.effects as noted in some related post on this thread. I have converted my data to long format for the purpose of estimating the nested logit. However, each time I used the code.
effects(nested, covariate = "my Covariate", data = "myData")

Here's my code:
data2 = read.csv(file = "neat_num_energy.csv")


new_ener2<- mlogit.data(data2,choice="alter4",shape="long", alt.var="energy_altern",chid.var="id")




nest2 <- mlogit(alter4~expendmaint+expendnegy|educ+sex +ppa_power_sp+ hu_price_powersupply +hu_2price +hu_3price + hu_9price + hu_10price +hu_11price + hu_12price, data2,
nests = list(Trad = c('Biomas_Trad', 'Solar_Trad'), modern = c('Biomas_Modern', 'Solar_Modern')), unscaled=FALSE)


m
summary(nest2)


####USE DATA2
z3 <- with(data2,data.frame(expendnegy = tapply(expendnegy, idx(nest2,2), mean),
expendmaint= tapply(expendmaint, idx(nest2,2), mean),
educ= mean(educ),
sex = mean(sex),
hu_price_powersupply = mean(hu_price_powersupply),
ppa_power_sp = mean(ppa_power_sp),
hu_2price = mean(hu_2price),
hu_3price = mean(hu_3price),
hu_9price = mean(hu_9price),
hu_10price = mean(hu_10price),
hu_11price = mean(hu_11price),
ppa_power_sp = mean(ppa_power_sp),
hu_12price = mean(hu_12price )) )


effects(nest2, covariate = "income", data = z3, type = "ar")






the attached PDF file shows the error message I'm getting.pls help
 

Attachments