similar to: simulate binary data from a logistic regression model

Displaying 20 results from an estimated 4000 matches similar to: "simulate binary data from a logistic regression model"

2003 Jun 04
3
cook distance
where is the cook-distance in R? i can't find it!please help me!
2010 Jul 31
3
I have a problem
dear£º in the example£¨nomogram£©£¬I don't understand the meanings of the program which have been marked by red line.And how to compile the program(L <- .4*(sex=='male') + .045*(age-50) + (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))). n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10)
2010 Dec 09
1
Calculating odds ratios from logistic GAM model
Dear R-helpers I have a question related to logistic GAM models. Consider the following example: # Load package library(mgcv) # Simulation of dataset n <- 1000 set.seed(0) age <- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120, 15) cholesterol <- rnorm(n, 200, 25) sex <- factor(sample(c('female','male'), n,TRUE)) L <-
2005 Aug 22
1
How to add legend of plot.Design function (method=image)? (if (!.R.) )
Hi, When running z <- plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image') Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)), zlab='Probability') And after pointing the cursor to the plot() screen in R, I obtain the following message: Using function "locator(2)" to place opposite corners of image.legend Error in
2010 Oct 06
2
A problem --thank you
dear:teacher i have a problem which about the polr()(package "MASS"), if the response must have 3 or more levels? and how to fit the polr() to 2 levels? thank you. turly yours [[alternative HTML version deleted]]
2018 Jan 03
1
summary.rms help
Dear All, using the example from the help of summary.rms library(rms) n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120, 15) cholesterol <- rnorm(n, 200, 25) sex <- factor(sample(c('female','male'), n,TRUE)) label(age) <- 'Age'
2002 Sep 13
1
design package (plot problems)
Hi, just making some experiments with design library i get an error if i want plot(fit) - show below from onlineHelp !? ..perhaps is here another mask problem?, but label from xtable which was my first problem is now off ! Thanks for advance & regards, Christian $ n <- 1000 # define sample size $ set.seed(17) # so can reproduce the results $ age <- rnorm(n, 50, 10)
2009 Apr 07
1
Simulate binary data for a logistic regression Monte Carlo
Hello, I am trying to simulate binary outcome data for a logistic regression Monte Carlo study. I need to eventually be able to manipulate the structure of the error term to give groups of observations a random effect. Right now I am just doing a very basic set up to make sure I can recover the parameters properly. I am running into trouble with the code below. It works if you take out the object
2009 Jul 17
1
c-index validation from Design library
Hi Group, I have a question about obtaining the bias-corrected c-index using validate from the Design library. As an example, consider the example from help page: library(Design) ?validate.lrm n <- 1000 age <- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120, 15) cholesterol <- rnorm(n, 200, 25) sex <- factor(sample(c('female','male'),
2008 May 29
2
Troubles plotting lrm output in Design Library
Dear R-helpers, I'm having a problem in using plot.design in Design Library. Tho following example code produce the error: > n <- 1000 # define sample size > set.seed(17) # so can reproduce the results > age <- rnorm(n, 50, 10) > blood.pressure <- rnorm(n, 120, 15) > cholesterol <- rnorm(n, 200, 25) > sex <-
2010 Aug 14
1
How to add lines to lattice plot produced by rms::bplot
I have a plot produced by function bplot (package = rms) that is really a lattice plot (class="trellis"). It is similar to this plot produced by a very minor modification of the first example on the bplot help page: requiere(rms) n <- 1000 # define sample size set.seed(17) # so can reproduce the results age <- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120,
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list, I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance. I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2010 Jul 29
1
I need the dataset--thank you
dear: I am a user of R project.And now ,I have a problem. I want to know what is the name of the datasets in the web page--"Draw a Nomogram Representing a Regression Fit" which come from the R-home(http://www.r-project.org/ Package rms version 3.0-0). And can you supply the dataset to me? wish for your help,thank you!
2003 Oct 21
3
BEGINNER: please help me to write my VERY simple function
Hi. 1)I have two variables: call a<-c(e.g.0,3,6,7...) b<-c(e.g.6,8,3,4...) I want to create a third vector z wich contain the pairs values z<-c(0,6,3,8,6,3,7,4....and so on for each pairs (a,b)). There is a specific function? How can i write my own function? 2)When i try to write a function and then i save it like "function.R" file, i try to
2012 Oct 20
1
Logistic regression/Cut point? predict ??
I am new to R and I am trying to do a monte carlo simulation where I generate data and interject error then test various cut points; however, my output was garbage (at x equal zero, I did not get .50) I am basically testing the performance of classifiers. Here is the code: n <- 1000; # Sample size fitglm <- function(sigma,tau){ x <- rnorm(n,0,sigma) intercept <- 0 beta
2003 Jun 04
3
3d scatter plot
how can i draw a 3d scatter plot? thank you.
2010 Apr 01
2
About logistic regression
Hi, I have a dichotomous variable (Q1) whose answers are Yes or No. Also I have 2 categorical explanatory variables (V1 and V2) with two levels each. I used logistic regression to determine whether there is an effect of V1, V2 or an interaction between them. I used the R and SAS, just for the conference. It happens that there is disagreement about the effect of the explanatory variables
2006 Aug 31
3
what's wrong with my simulation programs on logistic regression
Dear friends, I'm doing a simulation on logistic regression model, but the programs can't work well,please help me to correct it and give some suggestions. My programs: data<-matrix(rnorm(400),ncol=8) #sample size is 50 data<-data.frame(data) names(data)<-c(paste("x",1:8,sep="")) #8 independent variables,x1-x8; #logistic regression model is
2008 Nov 08
3
Fitting a modified logistic with glm?
Hi all, Where f(x) is a logistic function, I have data that follow: g(x) = f(x)*.5 + .5 How would you suggest I modify the standard glm(..., family='binomial') function to fit this? Here's an example of a clearly ill-advised attempt to simply use the standard glm(..., family='binomial') approach: ######## # First generate some data ######## #define the scale and location of
2006 Apr 03
1
Does logistic regression require the independence of samples?
Dear list: Thanks a lot for help. I have a question and I could not find clear answers easily. When we do logistic regression for one type of events of interest as a proportion of a broader types of events, does the logistic regression assume that the number of whole types of events should be independent with the number of type of interest? For example, if one type of events and the whole type