similar to: predict.lm, matrix in formula and newdata

Displaying 20 results from an estimated 10000 matches similar to: "predict.lm, matrix in formula and newdata"

2023 Oct 31
1
weights vs. offset (negative binomial regression)
[Please keep r-help in the cc: list] I don't quite know how to interpret the difference between specifying effort as an offset vs. as weights; I would have to spend more time thinking about it/working through it than I have available at the moment. I don't know that specifying effort as weights is *wrong*, but I don't know that it's right or what it is doing: if I were
2007 May 11
1
model seleciton by leave-one-out cross-validation
Hi, all When I am using mle.cv(wle), I find a interesting problem: I can't do leave-one-out cross-validation with mle.cv(wle). I will illustrate the problem as following: > xx=matrix(rnorm(20*3),ncol=3) > bb=c(1,2,0) > yy=xx%*%bb+rnorm(20,0,0.001)+0 > summary(mle.cv(yy~xx,split=nrow(xx)-1,monte.carlo=2*nrow(xx),verbose=T), num.max=1)[[1]] mle.cv: dimension of the split subsample
2009 Mar 28
1
Error in R??
Can someone explain why I am getting the following error: in the r code below? Error in solve.default(diag(2) + ((1/currvar) * (XX1 %*% t(XX1)))) : system is computationally singular: reciprocal condition number = 0 In addition: There were 50 or more warnings (use warnings() to see the first 50) The R code is part of a bigger program. ##sample from full conditional
2010 May 05
1
Predict when regressors are passed through a data matrix
Hi everyone, this should be pretty basic but I need asking for help as I got stuck. I am running simple linear regression models on R with k regressors where k > 1. In order to automate my code I packed all the regressors in a matrix X so that lm(y~X) will always produce the results I want regardless of the variables in X. I am new to R but I found this advice somewhere so I guess it is
2011 Nov 17
1
Vectorizing for weighted distance
Hi All, I am trying to convert the following piece of matlab code to R: XX1 = sum(w(:,ones(1,N1)).*X1.*X1,1); #square the elements of X1, weight it and repeat this vector N1 times XX2 = sum(w(:,ones(1,N2)).*X2.*X2,1); #square the elements of X2, weigh and repeat this vector N2 times X1X2 = (w(:,ones(1,N1)).*X1)'*X2; #get the weighted 'covariance'
2008 Dec 16
8
sliding window over a large vector
Hi all, I have a very large binary vector, I wish to calculate the number of 1's over sliding windows. this is my very slow function slide<-function(seq,window){ n<-length(seq)-window tot<-c() tot[1]<-sum(seq[1:window]) for (i in 2:n) { tot[i]<- tot[i-1]-seq[i-1]+seq[i] } return(tot) } this works well for for reasonably sized vectors. Does
2003 Jul 08
2
Can anybody help me on this?
Hi there: I have this configuration: |-----[Server 2] | [Internet]--------[Router]----------[Switch]------------ [Server 1] | |-----[PC1] | |-----[PC2] | |-----[PC3] Server 1 has IP 216.251.XXX.XX1 Server 2 has IP 216.251.XXX.XX2 PC1 has IP 216.251.XXX.XX3 PC2 has IP 192.168.XXX.1 PC3 has IP 192.168.XXX.2 How do I configure shorewall in SERVER 2 to block to/from the Internet Port 22
2007 Jan 30
2
dev IFB, few questions
I''ve made some tests... eth2 is my internal interface, LAN is connected here. Before I had IMQ device in AB mode... PREROUTING [A]fter NAT, POSTROUTING [B]efore NAT. I want the same situation on ifb. I do this in this way: --- # incoming traffic here from LAN is before NAT tc qdisc add dev eth2 handle ffff: ingress # outcoming traffic here from WAN is after NAT tc qdisc add dev eth2
2011 Dec 05
1
plot mixed variables
My data consists of a numeric (yy) variable and a categorical (xx) variable, as shown below. xx = c(rep("C", 5), rep("D",5)) yy = rnorm(10, 0, 4) xx1 = as.integer(as.factor(xx))   plot(xx1, yy, ylim = c(-13.5, 4), col="blue")   I wish to generate a scatter plot of the data such that instead of 1 it prints C, and instead of 2, it prints D on the x- axis.
2007 Oct 14
1
iPhone 1.1.1 problems.
I'm having problems with the iPhone client in the 1.1.1 version of the iPhone software. Things with other clients work fine, and the iPhone worked fine before it was upgraded to 1.1.1. Other phones on 1.1.1 failed. I'm still working on testing against the client with the iPhone 1.0.2 software on it. The problem is that the client simply doesn't connect to dovecot. I can see the
2010 Jun 15
4
Unable to pickup an extension, tryi
Hi! > How to do this ?? > To proceed with your answer on PICKUPMARK, where do I put this ??? Look at the example for Asterisk 1.4 on this page: http://www.voip-info.org/wiki/view/Asterisk+cmd+Pickup Philipp
2007 Nov 01
2
ploting a comparison of two scores, including the labels in the plot
Hello r-help! I have data with two kind of ratings on status of 100 occupations. The first kind of rating is on the percieved "objective" status that these occupations have in society at large, and the second kind or rating is on the status that the respondents think that these occuption *should* have. The ratings were originally integer values in the rage 1-9, but in the current data,
1999 Feb 16
1
Missing tick marks bug on alpha solved
On some systems (alpha), tick marks don't appear on plots. The easiest way to see the problem is something like: > plot(0:1,axes=FALSE) > axis(1,1:2) The problem is in X11_Line(...) from .../src/unix/devX11.c, which is so short I've included the whole function below: static void X11_Line(double x1, double y1, double x2, double y2, int coords, DevDesc *dd) {
2004 May 30
1
What's wrong with this simple code???
Hi, all I can not figure this out, please have a look and help me out. thank you! Note: this is in SPLUS, not R. I have following code *********************************** modfit<-function(yir,yew, ft) { n<-length(yew) yew<-yew[1:(n-1)] yy<-yir-ft xx<-yew-ft n<-length(xx) xx0<-xx[2:n] yy0 <-yy [2:n] xx1<-xx[1:(n-1)] fit <- garch(yy0~xx0 + xx1+var.in.mean,
2006 May 20
1
(PR#8877) predict.lm does not have a weights argument for newdata
Dear R developers, I am a little disappointed that my bug report only made it to the wishlist, with the argument: Well, it does not say it has. Only relevant to prediction intervals. predict.lm does calculate prediction intervals for linear models from weighted regression, so they should be correct, right? As far as I can see they are bound to be wrong in almost all cases, if no weights
2003 Dec 04
2
predict.gl1ce question
Hi, I'm using gl1ce with family=binomial like so: >yy succ fail [1,] 76 23 [2,] 32 67 [3,] 56 43 ... [24,] 81 18 >xx c1219 c643 X1 0.04545455 0.64274145 X2 0.17723669 0.90392792 ... X24 0.80629054 0.12239320 >test.gl1ce <- gl1ce(yy ~ xx, family = binomial(link=logit), bound = 0.5 ) or >omit <- c(2,3) >test.gl1ce
2008 Aug 08
8
RPro
I recently came across a flyer from REvolution Computing, and I wanted to ask if this is R going private? Tony. [[alternative HTML version deleted]]
2009 Sep 04
1
predicting from segmented regression
Hello I'm having trouble figuring out how to use the output of "segmented()" with a new set of predictor values. Using the example of the help file: ??set.seed(12) xx<-1:100 zz<-runif(100) yy<-2+1.5*pmax(xx-35,0)-1.5*pmax(xx-70,0)+15*pmax(zz-.5,0)+rnorm(100,0,2) dati<-data.frame(x=xx,y=yy,z=zz) out.lm<-lm(y~x,data=dati) o<-## S3
2020 Apr 28
2
Service Winbind stopped, what could be the reason ?
Hello dear Samba users, I recently faced an issue with samba (4.10.4) and winbind. The winbind service was stopped, so no user can acces to my samba share. I restart the winbind service, and all users can access to the share as usually... But I would like to understand why this issue occured. My samba server is a centos 7 linux, configured as domain member to a microsoft AD (windows server
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