У меня небольшой набор данных, я хочу применить к нему логистическую регрессию для прогнозирования myData $ Meeting
Я вставляю вывод dput моего объекта data.frame
myData <- structure(list(Item.Name = structure(c(1L, 14L, 2L, 12L, 2L,
11L), .Label = c("brinjal", "chocolate", "cold drink", "injections",
"jeans", "onion", "potato", "shirts", "skirts", "suit", "syrup",
"tablet", "tee", "wafer"), class = "factor"), Item.Group.Name =
structure(c(4L,
2L, 2L, 3L, 2L, 3L), .Label = c("apparel", "food", "medicine",
"vegetable"), class = "factor"), Quantity = c(44L, 97L, 53L,
11L, 5L, 71L), Sales.Employee.Name = structure(c(14L, 10L, 8L,
10L, 5L, 10L), .Label = c("Alysa Fontell", "Breanne Kissock",
"Clovis Mance", "Eadie Tidcomb", "Ella Tregidga", "Georg Hollyard",
"Gib Hanalan", "Jade Postle", "Jewelle Woodall", "Kent Franciottoi",
"Mychal Elix", "Ralina Wraight", "Shaughn Avrahamian", "Sibelle Santino",
"Sigfrid Alejandro"), class = "factor"), Sales.Employee.Manager =
structure(c(1L,
1L, 1L, 1L, 1L, 1L), .Label = "Hanny Stokey", class = "factor"),
Sales.Employee.Region = structure(c(2L, 5L, 4L, 5L, 4L, 5L
), .Label = c("America/Chicago", "America/Denver", "America/Kentucky/Louisville",
"America/Los_Angeles", "America/New_York"), class = "factor"),
Sales.Enquiry.Stage = structure(c(6L, 3L, 3L, 6L, 4L, 5L), .Label = c("Lead",
"Lost", "Meeting", "Proposal", "Qualified", "Won"), class = "factor"),
Final.Status = structure(c(1L, 1L, 1L, 1L, 2L, 2L), .Label = c("Closed",
"Open"), class = "factor"), Enquiry.Source.Sub.Type = structure(c(2L,
3L, 4L, 3L, 1L, 2L), .Label = c("Existing", "IB Call", "OB Call",
"Reference", "Website"), class = "factor"), Enquiry.Source.Type = structure(c(1L,
2L, 2L, 2L, 1L, 1L), .Label = c("Inbound", "Outbound"), class = "factor"),
Rate.per.Quantity = c(90L, 130L, 400L, 120L, 400L, 150L),
Estimate.Value = c(3960L, 12610L, 21200L, 1320L, 2000L, 10650L
), Employee.Gender = structure(c(2L, 1L, 2L, 2L, 1L, 2L), .Label = c("Female",
"Male"), class = "factor"), Meeting = structure(c(2L, 2L,
2L, 2L, 2L, NA), .Label = c("No", "Yes"), class = "factor")), row.names = c(NA,
6L), class = "data.frame")
, когдая запускаю этот код
glm(data = meetingData, formula = meetingData$Meeting ~. , family = binomial(link = "logit"))
я получаю эту ошибку,
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Любая помощь будет так благодарна и заметна.