[R] generalised linear models
To whom this may concern, I would be very grateful if someone could give me some advice on where I am going wrong with a logistic regression I am trying to run. I am trying to run a logistic regression on an aggregated data set and have input the command: logistic.mod-glm(x~Frequency+Location+Sex+Age.Group,family=binomial(link=logit),data=earsag1.dat) where x is the count of my response and frequency, location, sex and age.group are other variables. However, R gives an error because my values of x are not between 0 and 1. Therefore to compensate for this I denoted y= x/n where n is the number of people in each group and ran the regression logistic.mod-glm(y~Frequency+Location+Sex+Age.Group,family=binomial(link=logit),data=earsag1.dat) At this point R told me that my y values were not integer values and hence there was an error. I do not know how, therefore, to set up the logistic regression properly, so I would be very grateful if someone could give me some pointers. If I haven't explained anything well enough, let me know. Thanks very much for your help, Regards, Michael Gray __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] R: repeat loops
To whoever this may concern I am trying to write a repeat loop and can't make out from the documentation on the website how exactly to construct the repeat, break structure of the loop. Below is the function sim2.dat that I am trying to create, in which firstly I create n random uniform(0,1) numbers. From there I assign values to k, P and F. From then on for each random number u[j] of u, I try to set up a repeat loop so that if u[j]=F I alter P, k, and F and then compare u[j] to F again. I want to stop the loop when u[j]F and then assign the present value of k to u[j]. However my effort below seems to fail! Any help would be much appreciated, either with respect to repeat loops or better ways to conquer my problem. Thank you for your time, Regards, Michael Gray R text: sim2.dat-function(n,theta){ + u-runif(n) + k-1 + P--(1-theta)/log(theta) + F-P + for(j in 1:n){repeat{if(u[j]=F){P-k*(1-theta)*P/(k+1) + k-k+1 + F-F+P}} + if(u[j]F){break( + repeat{if(u[j]=F){P-k*(1-theta)*P/(k+1) + k-k+1 + F-F+P}}) + u[j]-k}} + u} __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] downloading R
To whoever this may concern, I have tried to download the latest version of the R program (rw2001.exe) from your website www.r-project.org onto my computer with Windows XP but with no success. Upon completion of the download (of the base distribution), I try to open the program and a error box appears saying 'the setup files are corrupted. Please obtain a new copy of the program'. I am unsure as to what the problem is and how to proceed. I would be grateful for any help, thank you for your assistance, Regards, Michael Gray __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html