Adding dependent variable to test data set



i have performed a logistic regression to a data set . Now i wanted to add a dependent variable to a new data set by using my model . how to do this ?


If the dependent variable is not present, you can use predict function in R .
Below is the example how you can do it.
ex: predict(model_name, new_dataset_name)


i have predicted for the test set . now i want to use the same model for another dataset which don not have dependent variable . so now i have to add dependent variable to the new data set


You should use a search engine and search for ‘how to add a variable to a dataframe in r’ OR ‘how to add a variable to a dataframe in python’ . With some effort, you will find the answer.