similar to: predict.glm

Displaying 20 results from an estimated 700 matches similar to: "predict.glm"

2008 Apr 04
2
predict.glm & newdata
Hi all - I'm stumped by the following mdl <- glm(resp ~ . , data = df, family=binomial, offset = ofst) WORKS yhat <- predict(mdl) WORKS yhat <- predict(mdl,newdata = df) FAILS Error in drop(X[, piv, drop = FALSE] %*% beta[piv]) : subscript out of bounds I've tried without offset, quoting binomial. The offset variable ofst IS in df. Previous postings indicate possible
2011 Sep 20
3
adding labels to x,y points
Hi, I am new to R. I have a matrix that I have assigned to the object ?colon?. > colon<-read.table("c:\\alon.txt",header=T,row.names=1) attach(colon) names(colon) The dimenstions are 2000 62. Each of the 62 columns (titled norm1, norm2, norm3, etc) has 2000 different numbers (?continuous? values) within it. I have also assigned a name for each of the 2000 rows of the
2006 Mar 07
3
glm automation
Hello, I have two problems in automating multiple glm(s) operations. The data file is tab delimited file with headers and two columns. like "ABC" "EFG" 1 2 2 3 3 4 dat <- read.table("FILENAME", header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE) dataf <- read.table("FILENAME", header=FALSE,
2013 Mar 28
2
hierarchical clustering with pearson's coefficient
Hello, I want to use pearson's correlation as distance between observations and then use any centroid based linkage distance (ex. Ward's distance) When linkage distances are formed as the Lance-Williams recursive formulation, they just require the initial distance between observations. See here: http://en.wikipedia.org/wiki/Ward%27s_method It is said that you have to use euclidean
2012 Jul 05
14
[net-next RFC V5 0/5] Multiqueue virtio-net
Hello All: This series is an update version of multiqueue virtio-net driver based on Krishna Kumar's work to let virtio-net use multiple rx/tx queues to do the packets reception and transmission. Please review and comments. Test Environment: - Intel(R) Xeon(R) CPU E5620 @ 2.40GHz, 8 cores 2 numa nodes - Two directed connected 82599 Test Summary: - Highlights: huge improvements on TCP_RR
2012 Jul 05
14
[net-next RFC V5 0/5] Multiqueue virtio-net
Hello All: This series is an update version of multiqueue virtio-net driver based on Krishna Kumar's work to let virtio-net use multiple rx/tx queues to do the packets reception and transmission. Please review and comments. Test Environment: - Intel(R) Xeon(R) CPU E5620 @ 2.40GHz, 8 cores 2 numa nodes - Two directed connected 82599 Test Summary: - Highlights: huge improvements on TCP_RR
2008 Feb 28
1
Errors melt()ing data...
Hi, I'm trying to melt() some data for subsequent cast()ing and am encoutering errors. The overall process requires a couple of casts()s and melt()s. ########Start Session 1########## ## I have the data in a (fully) melted format and can cast it fine... > norm1[1:10,] Pool SNP Sample.Name variable value 1 1 rs1045485 CA0092 Height.1 0.003488853 2 1 rs1045485
2012 Mar 21
2
glmnet: obtain predictions using predict and also by extracting coefficients
All, For my understanding, I wanted to see if I can get glmnet predictions using both the predict function and also by multiplying coefficients by the variable matrix. This is not worked out. Could anyone suggest where I am going wrong? I understand that I may not have the mean/intercept correct, but the scaling is also off, which suggests a bigger mistake. Thanks for your help. Juliet Hannah
2009 Mar 15
0
Axes crossing at origin
Hi, I'm having a bit of trouble with the axes in my plots. I don't like the way R does not have them cross in the origin. Is there another plot/axis function? i tried using abline as suggested by someone from this list, but in my case this gives no satisfactory result, as the abline does sometimes lie on top of the y axis and sometimes not, depending on how i scale the image... #bild16
2004 Apr 13
0
In-sample / Out-of-sample using R
I'm trying to learn how to use R to: * Make a random partition of a data frame between in-sample and out-of-sample * Estimate a model (e.g. lm()) for the in-sample * Make predictions for all observations * Compare the in-sample error sigma against the out-of-sample error sigma. I came up with the following code. I think it's okay, but I can't help feeling this is
2001 Apr 27
3
nls question
I have a question about passing arguments to the function f that nlm minimizes. I have no problems if I do this: x<-seq(0,1,.1) y<-1.1*x + (1-1.1) + rnorm(length(x),0,.1) fn<-function(p) { yhat<-p*x+(1-p) sum((y-yhat)^2) } out<-nlm(fn,p=1.5,hessian=TRUE) But I would like to define fn<-function(x,y,p) { yhat<-p*x+(1-p) sum((y-yhat)^2) } so
2002 Mar 08
1
Matrix multiplication problem
Dear List, I am having trouble with some R code I have written to perform Redundancy Analysis (RDA) on a matrix of species abundance data (Y) and a matrix of environmental data (X). RDA is a constrained form of PCA and can be thought of as a PCA of the fitted values of a regression of each variable in Y on all variables in X. For info, the first use of RDA is in: Rao, C.R, 1964. The use and
2012 Mar 08
1
sas retain statement in R or fitting differene equations in NLS
I wish to fit a dynamical model in R and I am running in a problem that requires some of your wisdom to solve. For SAS users I am searching for the equivalent of the */retain/ *statement. For people that want to read complicated explanations to help me: I have a system of two equations written as difference equations here. To boil it down. I have a dataframe with three variables y, X1, X2
2010 Feb 13
2
lm function in R
Hello, I am trying to learn how to perform Multiple Regression Analysis in R. I decided to take a simple example given in this PDF: http://www.utdallas.edu/~herve/abdi-prc-pretty.pdf I created a small CSV called, students.csv that contains the following data: s1 14 4 1 s2 23 4 2 s3 30 7 2 s4 50 7 4 s5 39 10 3 s6 67 10 6 Col headers: Student id, Memory span(Y), age(X1), speech rate(X2) Now
2008 Sep 16
2
Hosmer- Lemeshow test
Dear R - help, I am working on the Credit scorecard model. I am using the Logistic regression to arrive at the regression coefficients model. I want to use the Hosmer - Lemeshow test . In order to understand the use of R - language, I had referred the following URL       http://www.stat.sc.edu/~hitchcock/diseaseoutbreakRexample704.txt The related data 'diseaseoutbreak' is available
2011 May 08
1
Hosmer-Lemeshow 'goodness of fit'
I'm trying to do a Hosmer-Lemeshow 'goodness of fit' test on my logistic regression model. I found some code here: http://sas-and-r.blogspot.com/2010/09/example-87-hosmer-and-lemeshow-goodness.html The R code is above is a little complicated for me but I'm having trouble with my answer: Hosmer-Lemeshow: p=0.6163585 le Cessie and Houwelingen test (Design library): p=0.2843620
2012 Nov 16
2
R-Square in WLS
Hi, I am fitting a weighted least square regression and trying to compute SSE,SST and SSReg but I am not getting SST = SSReg + SSE and I dont know what I am coding wrong. Can you help please? xnam <-colnames(X) # colnames Design Matrix fmla1 <- as.formula(paste("Y ~",paste(xnam, collapse=
2004 Mar 05
4
Probit predictions outside (0,1) interval
Hi! I was trying to implement a probit model on a dichotomous outcome variable and found that the predictions were outside the (0,1) interval that one should get. I later tried it with some simulated data with a similar result. Here is a toy program I wrote and I cant figure why I should be getting such odd predictions. x1<-rnorm(1000) x2<-rnorm(1000) x3<-rnorm(1000)
2006 Apr 01
1
Nested error structure in nonlinear model
I am trying to fit a nonlinear regression model to data. There are several predictor variables and 8 parameters. I will write the model as Y ~ Yhat(theta1,...,theta8) OK, I can do this using nls() - but "only just" as there are not as many observations as might be desired. Now the problem is that we have a factor "Site" and I want to include a corresponding error
2013 Apr 23
1
Hosmer Lemeshow test
Hi to everybody. I use the following routine (i found it in the internet) to compute the Hosmer-Lemeshow test in the framework of logistic regression. hosmerlemeshow = function(obj, g=10) { # first, check to see if we fed in the right kind of object stopifnot(family(obj)$family=="binomial" && family(obj)$link=="logit") y = obj$model[[1]] # the double bracket