[R] Trouble with a loop

2012-03-05 Thread kerry1912
I am trying to run this loop but it keeps coming up with the following error: 'Error: no function to return from, jumping to top level' n.simul <- 1000 A <- {for(i in 1:12){{ nT <- rpois(n.simul, T[i]) nP <- rpois(n.simul, P[i]) nD <- rpois(n.simul, D[i]) nC <- rbinom(n.simul, nT, C[i]) Score <-

[R] simulating scores

2012-02-29 Thread kerry1912
I am currently looking at rugby scores and I have predicted 'T', 'C', 'P' and 'D' by using the predict function for a weekend of results. score <-5*T + 2*C + 3*P+ 3*Dr score So the output from the score function above is 12 values, as follows. Where 1 to 12 represent the teams involved in the ga

[R] goodness of fit for glms

2012-02-27 Thread kerry1912
We are working on trying to find how well glm models fit our set of sports results. We want to consider the following two models and work out which one fits the data better: >summary(Tries.Team.Ha.glm) (Dispersion parameter for poisson family taken to be 1) Null deviance: 321.46 on 269 deg

[R] Loop

2012-02-27 Thread kerry1912
I've tried to create a loop for the following code but have failed miserably. This is what the code is: pnorm((Normal.Team.LnAveragePPPConceded.LnAveragePPPScores.HA.pred[1,1] -Normal.Team.LnAveragePPPConceded.LnAveragePPPScores.HA.pred[50,1])/ sqrt(prediction.SE[1]^2 + prediction.SE[50]^2)) I'

Re: [R] And Statement for two if functions

2012-01-30 Thread kerry1912
Sorry that post was written in a bit if a rush. I am writing a function in which I am trying to create a league table from a data frame of rugby matches with the columns as follows: home team, away team, home score and away score. In rugby you can get an extra bonus point if you are the losing te

[R] And Statement for two if functions

2012-01-30 Thread kerry1912
I want to perform two if functions at the same time: if(home team > away team & home team <= away team + 7) in R but i am struggling to work out how to write this correctly. Thanks for any help. -- View this message in context: http://r.789695.n4.nabble.com/And-Statement-for-two-if-functions-

Re: [R] Prediciting sports team scores

2012-01-18 Thread kerry1912
In reply to the first comment: it isn't homework and is in fact to do with a betting system I am investigating for my own interest. -- View this message in context: http://r.789695.n4.nabble.com/Prediciting-sports-team-scores-tp4303708p4307787.html Sent from the R help mailing list archive at N

[R] Prediciting sports team scores

2012-01-17 Thread kerry1912
I am working on predicitng the scores for a days worth of matches of team sports. I have already collected data for the teams for the season we are concentrating on. I have been fitting poisson models for football games and have worked out what model is best and which predictor variables are most

[R] Making the lines thicker in histogram

2011-11-29 Thread kerry1912
I'm using a histogram and want to overlay this onto a barplot. I need the histogram lines to be thicker in order for it to stand out more on top of the barplot. Is there a command in order to do this? Thanks in advance. -- View this message in context: http://r.789695.n4.nabble.com/Making-the-li

[R] Histograms in R

2011-11-03 Thread kerry1912
We have a histogram of our observed response and we want to overlay the corresponding poisson distribution with respect to our poisson model. -- View this message in context: http://r.789695.n4.nabble.com/Histograms-in-R-tp3985397p3985397.html Sent from the R help mailing list archive at Nabble