I just learned what controlled variables mean for a project that I am doing, and I was trying to find if sci-kit learn has a controlled variable option. Specifically, does Python have controlled variable (not independent variables) for the logistic regression?

I googled stuff and found nothing for Python. However, I was thinking more basic and that controlled variables means stratifying the group you are interested (say race) and then going analysis on each group based on your x's and y. If this is correct, then I am suppose to interpret the results from those stratified groups, right?

Sorry, I asked two questions, but I am trying to gain much info on this controlled group idea and applications on Python
Apr 11, 2022 1,110 views

## 1 answer to this question.

Control variables, as you may know, are factors that the researcher is not interested in examining but believes have a substantial impact on the value that your dependent variable takes. When conducting experiments, or gathering data, people usually keep the value of this variable constant.

Assume you're trying to model a person's health status, i.e., determine whether he's healthy or not, and you're using age, gender, and his/her activity routine as inputs to your model, and you want to see how each input influences your target variable. However, as you are well aware, the country in which the individual resides has an impact on his health (which encodes the climate, heath facility etc.). So, to ensure that this variable (country) has no bearing on your model, you must collect all of your data from a single country.

So, in response to your first question, no, Python does not provide controlled variables. It just assumes that the experimenter is interested in all of the input variables you're sending in.

In response to your second question, one method of dealing with control variables is to first group the data with respect to it, so that each group now has a constant value for that control variable. We then run Logistic regression or any model separately for each group, and then 'pool' the results from different models. However, if the number of levels in your control variable is really large, we must treat it as an independent variable and feed it into our model.

Ignite Your Future with Machine Learning Training

answered Apr 14, 2022 by anonymous

## Logistic Regression with continuous data using sklearn in python

Despite the fact that it produces a ...READ MORE

## Example of Logistic regression with python code

Have a look at this: import csv import ...READ MORE

## Can someone explain to me the difference between a cost function and the gradient descent equation in logistic regression?

when we train a model with data, ...READ MORE

## how do i change string to a list?

suppose you have a string with a ...READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE