similar to: predict.glm returns different results for the same model

Displaying 20 results from an estimated 400 matches similar to: "predict.glm returns different results for the same model"

2018 Apr 27
0
predict.glm returns different results for the same model
On 27/04/2018 9:25 AM, Hadley Wickham wrote: > Hi all, > > Very surprising (to me!) and mystifying result from predict.glm(): the > predictions vary depending on whether or not I use ns() or > splines::ns(). Reprex follows: > > library(splines) > > set.seed(12345) > dat <- data.frame(claim = rbinom(1000, 1, 0.5)) > mns <- c(3.4, 3.6) > sds <- c(0.24,
2013 May 21
1
making makepredictcall() work
Dear All, I'm interested in creating a function similar to ns() from package splines that can be passed in a model formula. The idea is to produce "safe" predictions from a model using this function. As I have seen, to do this I need to use makepredictcall(). Consider the following toy example: myns <- function (x, df = NULL, knots = NULL, intercept = FALSE, Boundary.knots =
2003 Sep 07
3
bug in crossprod? (PR#4092)
# Your mailer is set to "none" (default on Windows), # hence we cannot send the bug report directly from R. # Please copy the bug report (after finishing it) to # your favorite email program and send it to # # r-bugs@r-project.org # ###################################################### # The last line of following code produces a segmentation fault: x <- 1:10 f <- gl(5,2)
2012 Feb 13
2
Error in apply(x2, 1, diff) : dim(X) must have a positive length
Anyone knows hat might be the cause of this error? Thanks for any help! >library(MASS) > dif.mns = function(x2,tr1=.2,tr2=.3){ + #generates four different 'means' using + #difference scores from x2, an n x 2 matrix + #for use w/ bootstrap comparisons + diffs = apply(x2,1,diff) + mn1=mean(diffs) + mn2=mean(diffs,tr=.2) + mn3=mean(diffs,tr=.3) +
2014 Mar 06
1
makepredictcall
An issue came up with the rms package today that makepredictcall would solve, and I was going to suggest it to the author. But looking in the help documents I couldn't find any reference to it. There is a manual page, but it does not give much aid in creating code for a new transformation function. Did I miss something? If not, I'd be willing to draft a paragraph about that which
2011 Feb 09
1
add mean and sd to dotplot in each panel using lattice
Hi, I have a data frame like this: ScoreDoseSex 2.81Dose1M 1.81Dose1M 1.22Dose1M 0.81Dose1M 0.49Dose1M 0.22Dose1M 0.00Dose1M -0.19Dose1M -0.17Dose1F -0.32Dose1F -0.46Dose1F -0.58Dose1F -0.70Dose1F -0.81Dose1F -0.91Dose1F -1.00Dose1F -1.77Dose2M -1.85Dose2M -1.93Dose2M -2.00Dose2M -2.07Dose2M -2.14Dose2M -2.20Dose2M -2.26Dose2M -2.32Dose2F -2.38Dose2F -2.17Dose2F -2.49Dose2F -2.54Dose2F
2008 Dec 19
2
error bars
Dear Help I'm new to R (from matlab)...using windows XP. I've tried to work out, to no avail, 4 things: 1) rotating the numbers on axes...something to do with par(str) ?? 2) how to close a window having opened one e.g. windows(7,7) 3) how to manipulate the key (e.g. dots, lines etc) on the legend. Using pch just gives me the same key for all functions on a plot. i.e. legend
2002 Mar 05
3
newbie: remove column with low mean from a matrix
Dear all, Sorry to bother you with one more newbie question. I have a dataobject with several hundreds of columns. I want to remove columns with a mean of the column values below a certain value: > a<- c(1,2,3,4,5,6) > b<-c(2,4,6,8,10,12) > c<- c(3,6,9,12,15,18) > test<- as.matrix(cbind(a, b, c)) > mean(a) [1] 3.5 > mean(b) [1] 7 > mean(c) [1] 10.5 Say the
2008 Jan 30
4
Loop with variable index
I have a list of 20 values. The first time through a loop I want to find the mean and stnd.dev. of the first two values; the second time through the loop I want to find the mean and stnd. dev. of the first 3 values, etc. until the last time through the loop I want to find the mean and stnd. dev. of all 20 values, so I end up with 19 means and stnd. deviations. How would I construct such a loop?
2010 Jan 29
2
Vectors with equal sd but different slope
Hi, what I would need are 2 vector pairs (x,y) and (x1,y1). x and x1 must have the same sd. y and y1 should also exhibit the same sd's but different ones as x and x1. Plotting x,y and x1,y1 should produce a plot with 2 vectors having a different slope. Plotting both vector pairs in one plot with fixed axes should reveal the different slope. many thanks syrvn -- View this message in
2012 Mar 30
4
Trying to understand factors
I'm trying to figure out about factors, however the on-line documentation is rather sparse. I guess, factors are intended for grouping arrays members into categories, which R names "Levels". And so we have: * state <- c("tas", "sa", "qld", "nsw", "nsw", "nt", "wa", "wa",
2010 Aug 30
2
while loop until end of file
Hi Guys, stumped by a simple problem. I would like to take a file of the form Pair group param1 1 D 10 1 D 10 1 R 10 1 D 10 2 D 10 2 D 10 2 D 10 2 R 10 2 R 10 etc.. and for each pair, calculate the average of
2005 Oct 18
3
CAPI - displaying individual MSN
Hi, I'm currently using chan_capi-cm-0.6, with the following capi.conf: [general] nationalprefix=0 internationalprefix=00 rxgain=0.8 txgain=0.8 language=de [ISDN1] msn=8304490 incomingmsn=8304490 isdnmode=msn group=1 controller=1 softdtmf=1 context=demo echosquelch=1 echocancel=yes echotail=64 callgroup=1 devices=2 Each user has a different numer, e.g. 83044910, 83044911, 83044912 and so
2010 Mar 17
2
How to use "ifelse" to generate random value from a distribution
I need use different parameters of distribution for different case to generate random value, but I use ifelse, the generated value is fixed without change. Here is example data1 y x 1 1 2 2 2 1 3 3 2 4 4 3 5 5 3 6 6 1 7 7 2 8 8 1 9 9 1 10 10 3 11 11 3 12 12 2 ifelse(data1$x==1,rnorm(1,2,1),ifelse(data1$x==2,rnorm(1,-2,1),rnorm(1,110,1))) [1] -1.8042172 0.8478681
2010 Jan 06
1
boxplot help
Dear Rexperts, I am trying to add a '+' identifying the mean in a boxplot using the following sizelist <- split(size, grp) centers <- boxplot(sizelist, style.bxp = "att", medpch = "o", ylab = "Prostate Volume (cm3)") points(centers, unlist(lapply(sizelist, mean)), pch = "+") But, I get error Error in xy.coords(x, y) :
2008 Jun 05
1
Graphing help revisited
Sorry, my last post came out unreadable. I'll try again. Here is the data. Think of them as transposed columns. A: 1,1,1,2,3,4,5,6,6, 7B: 5,5,6,7,7,7,8,9,10,11 Split the data into two groups, each of size 5, and make a scatterplot. Bill<-read.table('something here') attach(Bill)Bill.s<-split(Bill, rep(1:2, each=5))plot(A,B,col='black') Group
2008 Dec 24
1
Driver removal notification: al175
Hi Kirill, just to notify you that your al175 driver is being removed from the NUT tree, as of 2.4.0-pre1. if you wish to see it entering the tree again, please contact the Development mailing list to talk about it. Merry Christmas and happy New Year. Arnaud -- Linux / Unix Expert R&D - Eaton - http://www.eaton.com/mgeops Network UPS Tools (NUT) Project Leader -
2006 Apr 06
1
polynomial predict with lme
Does lme prediction work correctly with poly() terms? In the following simulated example, the predictions are wildly off. Or am I doing something daft? Milk yield for five cows is measured weekly for 45 weeks. Yield is simulated as cubic function of weekno + random cow effect (on intercept) + residual error. I want to recover an estimate of the fixed curve. ############### library(nlme)
2010 Apr 08
1
Placing the ≥ symbol in the Trellis custom strip
Hello, I am trying to use ≥ symbol in the Trellis custom strip. The ascii ALT Key for this symbol is 242. However, when I try "\242 90 kg" I get the ¢ symbol in the trellis custom strip. Can some one kindly help me? Thanking you in advance, MNS [[alternative HTML version deleted]]
2011 Oct 22
3
R for loop stops after 4 iterations
I have a data frame called e, dim is 27,3, the first 5 lines look like this: V1 V2 V3 V4 1 1673 0.36 0.08 Smith 2 167 0.36 0.08 Allen 3 99 0.37 0.06 Allen 4 116 0.38 0.07 Allen 5 95 0.41 0.08 Allen I am trying to calculate the proportion/percentage of V1 which would have values >0.42 if V2 was the mean of a normal distribution with V1