similar to: r bug (?) display of data

Displaying 20 results from an estimated 600 matches similar to: "r bug (?) display of data"

2012 Jul 12
2
nls question
 Hi:  Using nls how can I increase the numbers of iterations to go beyond 50.  I just want to be able to predict for the last two weeks of the year.  This is what I have:  weight_random <- runif(50,1,24)  weight <- sort(weight_random);weight weightData <- data.frame(weight,week=1:50)                          weightData plot(weight ~ week, weightData) M_model <- nls(weight ~ alpha +
2012 Aug 29
1
Help on not matching object lengths
Dear All   I have the following code set up: Code #1 a <-matrix(seq(0,8, by = sign(8-0)*0.25)) b <-matrix(seq(8,16, by = sign(16-8)*0.25)) c <-runif(1000,50,60) d <-exp(-c*a)+exp(-c*b)   This will give me the obvious error message of lengths not matching. What I am trying to do here is to have 33 rows x 1000 columns d values calculated in total. As an eaxmple for visual, this is what
2023 Nov 30
1
back tick names with predict function
?s 17:38 de 30/11/2023, Robert Baer escreveu: > I am having trouble using back ticks with the R extractor function > 'predict' and an lm() model.? I'm trying too construct some nice vectors > that can be used for plotting the two types of regression intervals.? I > think it works with normal column heading names but it fails when I have > "special"
2007 Feb 13
1
Missing variable in new dataframe for prediction
Hi, I'm using a loop to evaluate several models by taking adjacent variables from my dataframe. When i try to get predictions for new values, i get an error message about a missing variable in my new dataframe. Below is an example adapted from ?gam in mgcv package library(mgcv) set.seed(0) n<-400 sig<-2 x0 <- runif(n, 0, 1) x1 <- runif(n, 0, 1) x2 <- runif(n, 0, 1) x3 <-
2011 Apr 09
1
loop and sapply problem, help need
Dear R experts Sorry for this question M1 <- 1:10 lcd1 <- c(11, 22, 33, 44, 11, 22, 33, 33, 22, 11) lcd2 <- c(22, 11, 44, 11, 33, 11, 22, 22, 11, 22) lcd3 <- c(12, 12, 34, 14, 13, 12, 23, 23, 12, 12) #generating variables through sampling pvec <- c("PR1", "PR2", "PR3", "PR4", "PR5", "PR6", "PR7",
2007 Feb 23
2
Extracting a subset from a dataframe
Good day everyone, Can anyone suggest an effective method to solve the following problem: I have 2 dataframes D1 and D2 as follows: D1: dates ws wc pwc 2005-10-19:12:00 10.8 80 81 2005-10-20:12:00 12.3 5 15 2005-10-21:15:00 12.3 3 15 2005-10-22:15:00 11.3 13 95 2005-10-23:12:00 12.3 13 2 2005-10-24:15:00 10.3 2 95 2005-10-25:15:00 10.3 2 2 D2:
2017 Jun 12
0
plotting gamm results in lattice
Hi Maria If you have problems just start with a small model with predictions and then plot with xyplot the same applies to xyplot Try library(gamm4) spring <- dget(file = "G:/1/example.txt") str(spring) 'data.frame': 11744 obs. of 11 variables: $ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 ... $ SITE_ID
2003 Jun 03
3
gam questions
Dear all, I'm a fairly new R user having two questions regarding gam: 1. The prediction example on p. 38 in the mgcv manual. In order to get predictions based on the original data set, by leaving out the 'newdata' argument ("newd" in the example), I get an error message "Warning message: the condition has length > 1 and only the first element will be used in: if
2011 Jul 01
1
how to apply several math/logic operations on columns/rows of a matrix
Dear R-Fans, The more I work with matrices (e.g., data.frames) the more I think it would be helpful to have functions to apply (several!) mathematical and/or logical operators column- or row-wise in a matrix. I know the function apply() and all its derivates (e.g., lapply) but I think this does not help for solving (e.g.) the following task: assume there is a 3x3 matrix: 1 2 4 4
2017 Nov 21
2
help
I am working on Johansen cointegration test, using urca and var package. in the selection of var, I have got following results. >VARselect(newd, lag.max = 10,type = "none") $selection AIC(n) HQ(n) SC(n) FPE(n) 6 6 6 5 $criteria 1 2 3 4 5 6 7 8 9 AIC(n) -3.818646e+01 -3.864064e+01
2011 Mar 20
4
predicting values from multiple regression
Hey List, I did a multiple regression and my final model looks as follows: model9<-lm(calP ~ nsP + I(st^2) + distPr + I(distPr^2)) Now I tried to predict the values for calP from this model using the following function: xv<-seq(0,89,by=1) yv<-predict(model9,list(distPr=xv,st=xv,nsP=xv)) The predicted values are however strange. Now I do not know weather just the model does not fit
2023 Nov 30
1
back tick names with predict function
I am having trouble using back ticks with the R extractor function 'predict' and an lm() model.? I'm trying too construct some nice vectors that can be used for plotting the two types of regression intervals.? I think it works with normal column heading names but it fails when I have "special" back-tick names.? Can anyone help with how I would reference these?? Short of
2017 Nov 21
2
help
thank you for your valuable reply. I have attached my commands, results, and data with this mail..maybe it will be beneficial for you to feedback. On Tue, Nov 21, 2017 at 9:13 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Your example is incomplete... as the bottom of this and every post says, > we need to be able to proceed from an empty R environment to wherever you
2017 Nov 21
0
help
Your example is incomplete... as the bottom of this and every post says, we need to be able to proceed from an empty R environment to wherever you are having the problem (reproducible), in as few steps as possible (minimal). The example needs to include data, preferably in R syntax as the dput function creates... see the howtos referenced below for help with that. [1], [2], [3] You also need to
2017 Jun 12
2
plotting gamm results in lattice
Dear all,? I hope that you can help me on this. I have been struggling to figure this out but I haven't found any solution. I am running a generalised mixed effect model, gamm4, for an ecology project. Below is the code for the model: model<-gamm4(LIFE.OE_spring~s(Q95, by=super.end.group)+Year+Hms_Rsctned+Hms_Poaching+X.broadleaved_woodland? ? ? ? ? ? ?+X.urban.suburban+X.CapWks,
2013 Apr 01
2
example to demonstrate benefits of poly in regression?
Here's my little discussion example for a quadratic regression: http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R Students press me to know the benefits of poly() over the more obvious regression formulas. I think I understand the theory on why poly() should be more numerically stable, but I'm having trouble writing down an example that proves the benefit of this. I
2012 Apr 02
1
gamm: tensor product and interaction
Hi list, I'm working with gamm models of this sort, using Simon Wood's mgcv library: gm<- gamm(Z~te(x,y),data=DATA,random=list(Group=~1)) gm1<-gamm(Z~te(x,y,by=Factor)+Factor,data=DATA,random=list(Group=~1)) with a dataset of about 70000 rows and 110 levels for Group in order to test whether tensor product smooths vary across factor levels. I was wondering if comparing those two
2013 Jul 08
1
error in "predict.gam" used with "bam"
Hello everyone. I am doing a logistic gam (package mgcv) on a pretty large dataframe (130.000 cases with 100 variables). Because of that, the gam is fitted on a random subset of 10000. Now when I want to predict the values for the rest of the data, I get the following error: > gam.basis_alleakti.1.pr=predict(gam.basis_alleakti.1, +
2002 Jul 26
0
predict() still not yet "safe".. (PR#1840)
Executive Summary: This only concerns predict() at new points when the formula contained things like poly() or ns() {in the RHS}. Because I hadn't have time to fix this yet, I submit it. [R version 1.5.1 and at least 1.4.1, probably all versions at all:] For these, R 1.5.x does not differ from 1.4.1 : Inspite of R 1.5.0's "NEWS" entry and the ?Safepredict help page,
2012 Mar 19
1
glm: getting the confidence interval for an Odds Ratio, when using predict()
Say I fit a logistic model and want to calculate an odds ratio between 2 sets of predictors. It is easy to obtain the difference in the predicted logodds using the predict() function, and thus get a point-estimate OR. But I can't see how to obtain the confidence interval for such an OR. For example: model <- glm(chd ~age.cat + male + lowed, family=binomial(logit)) pred1 <-