similar to: predict.lm within a function

Displaying 20 results from an estimated 2000 matches similar to: "predict.lm within a function"

2004 Dec 30
1
subsetting within a function
hi I am trying to write a function around a glm or similar function, in which I can pass the subsetting constraint as an argument to the function, but I am having trouble. the following commands (if I wanted SEX==0 to be my subset) in the global environment work fine: subexpr <- expression(SEX==0) subtest <- with(mydata, eval(subexpr)) test.glm <- glm(y~x1+x2, data=mydata,
2005 Jun 10
1
Problems with corARMA
Dear all I am tryiing to fit the following lme with an ARMA correlation structure: test <- lme(fixed=fev1f~year, random=~1|id2, data=pheno2, correlation=corARMA(value=0.2, form=~year|id2), na.action=na.omit) But I get the following error message: Error in getGroupsFormula.default(correlation, asList = TRUE) : "Form" argument must be a formula I have used this same form
2005 Jan 05
1
subsetting within a function using lme
Thankyou for your help with subsetting within a function. I have now tried to apply the same theory in the framework of an lme as follows: fit1.lme <- eval(substitute(lme(fixed=fixed, data=dataframe, random=random, correlation=corCAR1(form= corr), na.action=na.omit, subset=subset),list(subset=subs))) but I get the following error: Error in switch(mode(object), name = , numeric = , call =
2007 Dec 12
3
Measure of agreement??
Dear List, Please put me on the right track. I have been searching for the R functions for measures of agreement. Where should I look? Patrik Öhagen Läkemedelsverket Box 26 751 03 Uppsala Tel. +46(0)18-174924 patrik.ohagen@mpa.se [[alternative HTML version deleted]]
2009 Nov 25
1
Error in parse(outFile)
Hi all I have made some changes to a package (SimHap) I wrote a couple of years ago, and it has passed R CMD check under windows, but under linux (ubuntu jaunty) I am getting the following error: * installing *source* package 'SimHap' ... ** R Error in parse(outFile) : 2:1: unexpected $end ERROR: unable to collate files for package 'SimHap' Does anyone know what the
2007 Mar 05
4
about find the solution
If I want to find out the soltion of X1,X2 that min(3X1+2X2+X1X2) subject to 20<=X1+3X2<=50 10<=X1 which function or package can I use? Thanks.
2015 Aug 05
1
Samba4 not able to write to group writeable folder???
Hi... With samba4 I sometimes feel like a bloody beginner even I use samba since ages. Miracle of the day: Users connecting using samba4 cannot write to group writeable folders even they should be able to. I upgraded one 3.6 fileserver to 4.2.3. PDC is always a samba 4.2.3 instance. I am using samba4 in classic PDC mode for a couple of reasons. On my fileserver I have a folder called
2005 Apr 25
1
Need help with panel.segment..
Hi All, For the following code, I'm not sure why the error bars are appearing horizontal. Can someone please tell me how to fix the problem. testdata <-
2010 Aug 13
1
Bug in t.test?
Hello all, due to unexplained differences between statistical results from collaborators and our lab that arose in the same large proteomics dataset we reevaluated the t.test() function. Here, we found a weird behaviour that is also reproducible in the following small test dataset: Suppose, we have two vectors with numbers and some missing values that refer to the same individuals and that
2011 May 30
0
Question of the XLConnect package
Hi Everybody I have started to learn how to use the XLConnect package and I think it is going to be very helpful to help me to operate between Excel users. Is there a function that can export a dataframe to a Excel sheet and automatically create a named region for every column (excluding the column heading) that correspond to the column name? If this is possible one can then also create formulae
2011 Aug 29
3
how to start R script editor by default
Hi All, 1) Is it possible to set the options such that R opens a new script editor every time I start the R and 2) specify the size of windows. Thanks for the suggestion and Best regards, Krishna [[alternative HTML version deleted]]
2005 Apr 22
1
Need help arranging the plot in different fashion than the default format
I want to change the way the plot is appearing in the barchart .. testdata <-
2008 Aug 19
1
Exponential smoothing?
An r hel search picks up http://tolstoy.newcastle.edu.au/R/help/01a/1162.html from 2001, which points towards the ts package. >>> ?hagen Patrik <Patrik.Ohagen at mpa.se> 19/08/2008 09:00:12 >>> Dear List, I have used all my resources (i.e. "help.search) and I still havn't been able to figure out if there is an Exponential Smoothing command in R. Thank you in
2007 Sep 20
1
Bug with Cor(..., method='spearman") and by() (PR#9921)
I posted this on R help, and a few others responded indicating they too were able to replicate the error as a function of missing data. I believe this should not be the case and hence and reporting it here. ### Code provided on R-Help by Ivar Herfindal # Simulate data testdata <- cbind.data.frame(gr=3Drep(letters[1:4], each=3D5), = aa=3Drnorm(20), bb=3Drnorm(20)) # Introduce some missingness
2010 Mar 12
1
Length as fun.aggregate in cast function of reshape package: unexpected error
Dear Everyone, I am having problems with use of the reshape package's cast function using length as an aggregating function. Unexpectedly, I receive the error: 2 arguments passed to 'length' which requires 1 I don't understand this at all - the data I'm using is very simple, and appears almost identical to that used in the ChickWeight example in the package. The problem can
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My data have a variable called "RowNo" that functions almost like a
2003 Sep 23
2
confusion about what to expect?
In playing around with data.frames (and wanting a simple, cheap way to use the variable and case names in plots; but I've solved that with some hacks, yech), I noticed the following behavior with subsetting. testdata <- data.frame(matrix(1:20,nrow=4,ncol=5)) names(testdata) ## expect labels, get them names(testdata[2,]) ## expect labels, get them names(testdata[,2]) ## expect labels, but
2003 Jun 12
0
Re: (PR#3241) write.table() fails for POSIXlt class and NAs in
Uwe, You said you used testdata <- data.frame(date = strptime(c("31121991", "31121991"), "%d%m%Y"), nothing = c(NA, NA)) but that's not the same object, and that one does work for me. > dput(testdata) structure(list(date = structure(c(694137600, 694137600), class = c("POSIXt", "POSIXct")), nothing = c(NA, NA)),
2012 Mar 30
3
Adding text for written comments to bottom of graphs
Hello All, Recently developed the code below for graphing patterns of chemotherapy administration. As someone just starting to use R in their work, I managed to figure out some parts of the code but needed help with others. setwd("N:/Regimen Coding/0906/Plots Test") getwd() TestData <- structure(list(profile_key = c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3), line = c(1, 1,
2012 Dec 18
7
Summarizing elements for a data.frame
Hello again, let say we have following data: Dat1 <- structure(list(factor.sample.LETTERS.1.3...6..replace...T.. = structure(c(1L, 3L, 2L, 1L, 3L, 3L), .Label = c("A", "B", "C"), class = "factor"), factor.sample.letters.1.2...6..replace...T.. = structure(c(2L, 2L, 1L, 1L, 2L, 1L), .Label = c("a", "b"), class =