3,722 questions
0
votes
0
answers
24
views
LMest - Reference of the multilogit - how to know the significance [migrated]
We run latent transition analysis with covariates using LMest and with the help of the available Literature (e.g., Bartolucci et al., 2017) and what we found on the web, we were also able to interpret ...
1
vote
1
answer
63
views
Combining lines in a predicted probability plot without changing the regression model
I have a dataset with a binary outcome income and two continuous predictors, age, and education_num. I'm fitting a logistic regression model with a natural spline for age and an interaction with ...
2
votes
1
answer
257
views
Multinomial regression with statsmodels.formula.api is not working for me
Whenever I try to build a multinomial regression using the R-style formula approach in statsmodels in Python, I get ValueError: endog has evaluated to an array with multiple columns...
Here's a ...
0
votes
1
answer
100
views
Simulating a Discrete-Choice/Multinomial Model
I want to simulate a Discrete-Choice/Multinomial model. Consider the situation where I have 100 people each with four choices (1 = air, 2 = bus, 3 = car, 4 = train).
There is a baseline preference ...
0
votes
1
answer
70
views
Issue with home-made forest plot in R ggplot2
I'm creating a forest plot for my logistic regression model in R. I am not happy with the forest plot created by some packages, especially because the names of the predictors and the levels of the ...
3
votes
1
answer
44
views
How can I impute missing date values by using the average difference between two date columns?
Thanks in advance for any help you can provide. I have a dataset containing some healthcare data and am trying my hand at using python for EDA/regression modeling on the set. I have one date column [...
0
votes
0
answers
26
views
Logistic regression variables correlation but low GVIF
I'm making a logistic regression model to predict female presence on boards in tech SMEs. I was going to take out companies with only 1 employee, as they don't have boards, but my supervisor told me ...
1
vote
1
answer
369
views
Why is glmer function for logistic regression taking so long to run in R?
I am running a multiple logistic regression model. The dataset has ~350,000 observations, with the outcome being a binary 0/1 dichotomous variable. Most predictors are also dichotomous but there are ...
2
votes
1
answer
91
views
Offsetting in rms::lrm ... error: sformula not found? [duplicate]
I am trying to fit a model into an lrm framework so I can bootstrap it with validate. The model has already been developed elsewhere. However, when I use an offset term to account for coefficients ...
0
votes
0
answers
156
views
Implementing survey weights in statsmodels OrderedModel ordinal logistic regression
I am trying to run an ordinal logistic regression on survey data and implementing existing survey weights (stored in a column in the dataframe) in the model. I am using statsmodels.miscmodels....
0
votes
0
answers
38
views
Partial derivative of logistic function for Levenberg-Marquardt
I am trying to write code that will fit logistic function to set of data. I am using Levenberg-Marquardt routine (as given in Numerical Recipes 3rd edition) and that requires me to supply a function ...
2
votes
2
answers
73
views
How to make a probability figure using a logistic regression?
I am trying to remake this figure with my data.
I have 2 binary factors (P treatment & Embryo_Presence_vs._Absence) and 1 continuous value (Final_Size). Here is my data:
print.data.frame(x[c(&...
0
votes
1
answer
160
views
Issues using GTSummary with Survey Package: Variable Column not found
So, I am running a logistic regression analysis and I finished using the survey package. Everything went smoothely. Now, I am trying to make tables using GT Summary and running into major issues. I ...
0
votes
1
answer
106
views
Why do I plot only one feature when visualizing predictions for a multi-feature regression model?
I am working on a regression task where my feature matrix consists of two features: a linear term and its square (quadratic feature). My model is predicting values correctly, but after numerous ...
1
vote
1
answer
48
views
How to plot different colored multiple logistic regressions + equations, ora by third factor
Sample data:
Discount Hit application
0.45 1 prize
0.37 1 prize
0.18 0 prize
0.30 0 prize
0.22 1 prize
0.21 1 prize
0.65 1 yellow
0.31 1 ...
0
votes
1
answer
82
views
Python scorecardpy: UnboundLocalError: local variable 'card_df' referenced before assignment
I used scorecardpy function to get a model:
import scorecardpy as ac
card=sc.scorecard(bins_adj, lr, X_train.columns)
Then I tried to save this model using following code:
import numpy as np
np.save('...
0
votes
0
answers
54
views
How can I get the standard error of the standard deviation of the random intercept in a cumulative linear mixed model using "ordinal" package in R?
# A tibble: 7,500 × 4
cluster cluster_size x ordinal_y
<int> <int> <dbl> <fct>
1 1 1 2.57 4
2 1 2 3.59 4 ...
2
votes
0
answers
114
views
R GAMLSS : How to fit a log-logistic distribution (truncated)?
I'm trying to fit a log-logistic distribution (truncated) with GAMLSS and can't find how to do it.
In the documentation, it says that for Generalized Beta 2 (GB2) :
Setting ν = 1 and τ = 1 in (15.20) ...
1
vote
4
answers
121
views
Explode / unpivot DataFrame containing count data to one row per item
Context: Data transformation for a logistic regression problem. I have the following data structure:
df = pd.DataFrame({"group": ["A", "B"], "total": [3, 5], &...
-1
votes
1
answer
94
views
LogisticRegression not returning correct results
I am trying to predict a classification using logistic regression, based on training data, for a series of points in testing data.
I am getting an output, without errors, but the results, I am told, ...
0
votes
1
answer
46
views
Error using contrast package for logistic regression (glm)
I am looking for an easier way to do a contrast statement in R (rather than multcomp) and came across the contrast package. The syntax seems simple but I keep getting an error. Here is my model and ...
1
vote
0
answers
157
views
Difference in Standard Errors and p-Values in Two-Way Fixed Effects Logit Model with Interaction Terms using fixest Package in R
I'm working with a two-way fixed effects (TWFE) logit model in R using the fixest package. My model includes interaction terms between some fixed effects and a categorical variable called group. To ...
0
votes
0
answers
113
views
Issue with MICE package and generation of logistic regression
I am using a publicly available dataset (National Health Interview Survey). I am studying heart disease as the outcome variable and examining the impact of several clinicodemographic factors on ...
2
votes
1
answer
200
views
Finding confidence interval for response variables in ordinal logistic model
While working with private data, I noticed that the ordinal logistic model fitted using the polr function from the MASS package, along with the confidence intervals provided by broom::tidy, does not ...
-4
votes
1
answer
104
views
I am getting error in importing logistic regression in jupyter notebook
error iris flower classification
I am building a classification model for Iris flower classification by using Logistic Regression. I am using jupyter notebook and I am importing Logistic Regression by ...