最近要处理logit回归的交互效应,因变量是二分类的dummy,自变量有分类变量也有数值型变量,我看网上有说做分类型变量的回归要在变量名前面加“i.”,我加上后跑logit函数没有问题(第一条代码),但是跑inteff函数就报错了:
factor-variable and time-series operators not allowed,然后我尝试将“i.”去掉,还是报错:“variable BathroomsIsCov19 not found”,说找不到交互项,这要咋办呀?球球了
- logit Alive NumberofReviews Bathrooms MaxGuests ResponseRate i.AirbnbSuperhost MinimumStay NumberofPhotos i.InstantbookEnabled i.ExactLocation OverallRating i.PetsAllowed YearsSinceOpen i.Kitchen i.Breakfast i.Elevator i.AllowsSmoking i.Washer i.LaptopFriendly i.LongTermStaysAllowed i.FirstAidKit i.AccommadationType1 i.AccommadationType2 i.IsCov19 i.ListingTypeN i.CancellationPolicyN i.ParkingN
- . inteff Alive Bathrooms i.IsCov19 Bathroomsi.IsCov19 NumberofReviews MaxGuests ResponseRate i.AirbnbSuperhost MinimumStay NumberofPhotos i.InstantbookEnabled i.ExactLoc
- > ation OverallRating i.PetsAllowed YearsSinceOpen i.Kitchen i.Breakfast i.Elevator i.AllowsSmoking i.Washer i.LaptopFriendly i.LongTermStaysAllowed i.FirstAidKit i.Acco
- > mmadationType1 i.AccommadationType2 i.ListingTypeN i.CancellationPolicyN i.ParkingN
- factor-variable and time-series operators not allowed
- . inteff Alive Bathrooms IsCov19 BathroomsIsCov19 NumberofReviews MaxGuests ResponseRate AirbnbSuperhost MinimumStay NumberofPhotos InstantbookEnabled ExactLocation Over
- > allRating PetsAllowed YearsSinceOpen Kitchen Breakfast Elevator AllowsSmoking Washer LaptopFriendly LongTermStaysAllowed FirstAidKit AccommadationType1 AccommadationTy
- > pe2 ListingTypeN CancellationPolicyN ParkingN
- variable BathroomsIsCov19 not found
复制代码