how to run a logistic regression with clustered standard errors in R

0 votes

How to run a logistic regression with clustered standard errors in R?

Nov 6, 2018 in Data Analytics by Hannah
• 18,570 points
1,472 views

1 answer to this question.

0 votes

have a look at rms package. lrm is logistic regression model, and if fit is the name of your output, you'd have something like this:

fit=lrm(disease ~ age + study + rcs(bmi,3), x=T, y=T, data=dataf)

fit

robcov(fit, cluster=dataf$id)

bootcov(fit,cluster=dataf$id)

You have to specify x=T, y=T in the model statement. rcs indicates restricted cubic splines with 3 knots.

answered Nov 6, 2018 by Kalgi
• 52,360 points

Related Questions In Data Analytics

0 votes
1 answer

How to filter a data frame with dplyr and tidy evaluation in R?

Requires the use of map_df to run each model, ...READ MORE

answered May 17, 2018 in Data Analytics by DataKing99
• 8,240 points
1,609 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,740 points
4,190 views
0 votes
1 answer

How to run a file with .r extension?

Follow the below command: C:\Program Files\R\R-3.1.1\bin\Rscript.e ...READ MORE

answered Apr 30, 2019 in Data Analytics by Tyrion anex
• 8,700 points
756 views
0 votes
1 answer

How to filter only those rows with a condition in R?

Write R code as below temp = data ...READ MORE

answered Jul 15, 2019 in Data Analytics by anonymous
• 33,030 points
580 views
+1 vote
2 answers

How to sort a data frame by columns in R?

You can use dplyr function arrange() like ...READ MORE

answered Aug 21, 2019 in Data Analytics by anonymous
• 33,030 points
1,401 views
+10 votes
3 answers

Which is a better initiative to learn data science: Python or R?

Well it truly depends on your requirement, If ...READ MORE

answered Aug 9, 2018 in Data Analytics by Abhi
• 3,720 points
1,100 views
0 votes
1 answer

How can I perform word stemming in R

The tm package in R provides the stemDocument() function to stem the ...READ MORE

answered Aug 20, 2018 in Data Analytics by Abhi
• 3,720 points
3,915 views
0 votes
1 answer

How to know the type of an object?

To find the type of an object ...READ MORE

answered Sep 20, 2018 in Data Analytics by Abhi
• 3,720 points
451 views
0 votes
2 answers

How to add sliderbars in a shiny R dashboard?

To add slider bar and slider range ...READ MORE

answered Dec 5, 2018 in Data Analytics by Kalgi
• 52,360 points
1,114 views
+1 vote
1 answer

How to check if object is defines in R?

You can use the exists function for ...READ MORE

answered Nov 6, 2018 in Data Analytics by Kalgi
• 52,360 points
437 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP