In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to do Logistic regression in R language? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Application scenario of Logistic regression
Logistic regression is a very common tool when the dependent variable is a binary result variable and the independent variable includes data of continuous type and category type. For example, the extramarital affair data "Fair's Affairs" is used in today's example. The dependent variable is whether there have been extramarital affairs, there are 8 independent variables, which are
Sex, age, marriage age, whether there is a child's religious belief (5 points, 1 for opposition, 5 for very belief), education, occupation (reverse numbered Gordon 7 categories) what does this mean? ) self-rating of marriage
The dependent variable y is the number of derailments, which is converted to binary type. The number of derailments is greater than or equal to 1, and the assignment is 1, on the contrary, the assignment is 0.
Let's start the actual operation.
This dataset comes from the R language package AER. If you want to use this dataset, you need to install this package first.
Install.packages ("AER")
Then use the data () function to get the dataset
Data (Affairs,package = "AER")
Then you can see the following in the window of the environment
This dataset has a total of 601 observations and a total of 9 variables
The next step is to convert the variable y times of derailment to binary df.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 272
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.