similar to: Ongoing unhappiness with NA and factor behavior of distributed lm/predict.lm

Displaying 20 results from an estimated 4000 matches similar to: "Ongoing unhappiness with NA and factor behavior of distributed lm/predict.lm"

2002 Feb 14
0
two comments regarding predict.lm
Here is the first one. It concerns the handling of multiple offsets. The following lines creates a list with 3 explanatory variables and one response. > x<-seq(0,1,length=10);y<-sin(x);z<-cos(x); w<-x+y+z+rnorm(x) > data<-list(x=x,y=y,z=z,w=w) A lm is fitted with one explanatory variable and two offsets. So far, so good. >
2003 Aug 13
1
The desire for prettier and cheaper images ...
This might be easy (but I didn't find an answer in the archives). I'm trying to make nice looking images (using image()). To make them look nice (not jagged), it usually takes me at least 100x100 points. This can be slow for frequent redraws. Is there a smarter (less point intensive) way? I was thinking in terms of hexabins, for example, which for much less jagged looking regions,
2002 Dec 18
1
A little problem handling logicals in RMySQL under R1.6.1
There is a little problem in handling logicals in RMySQL: # here is the MySQL connection > con <MySQLConnection:(1816,0)> # here is the data frame > print(a<-data.frame(x=c(TRUE,FALSE),y=c(FALSE,TRUE))) x y 1 TRUE FALSE 2 FALSE TRUE # as promised, the two data frame columns are identified as logicals and # the field types are set to tinyint > field.types <-
2003 Aug 18
1
rterm not shutting down from ESS on Win32/could we help?
Hi to all who suffer from rterm not shutting down in xemacs/ESS on windows NT or 2000. Also hi to those who could eventually help. Here is some more information which could help and some ENCOURAGEMENT to contribute to a solution. 1. It may be an xemacs problem but it is more likely an interaction between rterm/comint/and xemacs. In fact, the problem started occurring around version R 1.6.0. I
2004 Sep 09
2
Handling the windows clipboard/32KB limit
(R 1.9.1; Windows 2000;) I'm just comparing ease of use, speed, etc for methods of transferring data frames in the Excel, MySQL, R triangle. It turns out that going from Excel to R (when doing this carefully). Using the clipboard is actually quite fast and efficient (2 seconds for transferring 120 000 cells on a common desktop computer as compared to much longer for going the RODBC route,
2002 Jan 22
0
lm/model.frame.default surgery: Am I doing something crazy?
This message is for people who know the mechanics of model.frame within lm. I am fitting lm models for different responses on a data frame which has (at least some) factors. As it happens, some of the responses are NA for some of the factor levels. Logically, lm creates an xlevels list for which the length of levels is different from the original number of levels in the data frame (a
2005 Feb 23
2
Slightly off topic but concerning R#DSC-2005
Has anyone seen an official announcement to DSC-2005. I saw and email exchange on the R-news list in mid January in which a date was announced unofficially. (to DSC-organizers: we need and "official" announcement to request funding and travel permission and flights from Europe to Seattle are starting to fill up, so this is urgent). Christian Ritter Functional Specialist Statistics Shell
2005 Jun 30
1
request/suggestion: modified names
For some time now I use a modified version of names (extract direction) of the following type: Names<- function (x,filter="^") { grep(filter,names(x),value=TRUE) } Request: Has anyone already written a version which goes the other way (that is, which allows assignment of the type Names(x,filter)<-...). Naive versions are obvious, but I think something would have to be done
2007 Jun 11
1
Looking for R-code for non-negative matrix factorization in the presence of Gaussian or Poisson noise
Hi all, Has any of you implemented code for non-negative matrix factorization to solve Y=T P' +E; dim(Y)=n,p ; dim(T)=n,nc; dim (P)=(p,nc); dim(E)=n,p where T and P must be non-negative and E either Gaussian or Poisson noise. I'm looking for two variants: 1. Easy (I think), T is known (that is we just want to solve the general inverse problem) 2. Harder (?), T is unknown (under some
2005 Jul 12
2
unexpected behavior in bwplot
R-2.1.1 on windows XP I just noticed something unpleasant when using bwplot (from lattice). In order to satisfy a wish from a client, I needed to produce sets of boxplots conditioned by another factor. My client didn't like the look of the boxplots (by default, they have a star to mark the median, instead of the commonly used line). I told him "no problem" dumped panel.bwplot,
2003 Sep 02
0
R/Chemometrics/reading .spa files into R.
Maybe someone out there has done this already .... (which would save me some time): For a repetitive chemometric task I need to retrieve spectra from a Nicolet IR acquisition system into R and analyze them there. The raw spectra are in files ending in the extension .spa. I can use the Omnic software to export them to .csv, but I would like to skip this step since it is manual. Has anyone of you
2006 Nov 30
1
Looking for nice implementations of rectangular scatterplot matrices
... finding myself doing this by hand one too many times ... maybe someone else has found a nice general solution ... I have a data frame containing n rows on p+q variables which I will call p.1, p2, ..., pp and q1, q2, ... qq. For simplicity all of these variables are continuous numeric. I want to create the following arrangement of plots: A scatterplot matrix which contains p times q panels
2006 Jul 11
0
Assistance with dll's to use with dyn.load
After having browsed the documentation for a while without discovering what I am looking for, maybe one of you would know ... What I want to do: I have two fortran files MC.f and ESCA.f. In MC.f there is a call to a routine called lpost. This routine (lpost) is defined (among other things) in ESCA.f. Under linux, I can do the following: R CMD SHLIB MC.f and R CMD SHLIB ESCA.f followed by
2000 Sep 28
1
non-ideal behavior in princomp
This problem is not limited to R, but R is one of the packages in which it arises. princomp is a nice function which creates an object for which inspection methods have been written. Unfortunately, princomp does not admit cases in which the x matrix is wider than high (i. e. more variables than observations). Such cases are typical in spectroscopy and related disciplines. It would be nice if the
2011 Mar 23
1
predict.lm How to introduce new data?
Dear all, I've fitted a lm using 61 data (training data), and I'left 10 as test data. Training data and test data are stored in an excell. training <- read.xls("C:/...../training.xls") , the same for test. That is: v1 v2 ... v15 When I type str(training) and str(test), both sets have the same names The resulting model is lms <- lm(vd ~ log(v1) + fv2+ fv5+ fv7 )
2003 Mar 26
5
predict (PR#2686)
# r-bugs@r-project.org `predict' complains about new factor levels, even if the "new" levels are merely levels in the original that didn't occur in the original fit and were sensibly dropped, and that don't occur in the prediction data either. (At least if `drop.unused.levels' was set to TRUE, which the default.) test> scrunge.data.2_ data.frame( y=runif( 3),
2019 Aug 30
3
inconsistent handling of factor, character, and logical predictors in lm()
Dear R-devel list members, I've discovered an inconsistency in how lm() and similar functions handle logical predictors as opposed to factor or character predictors. An "lm" object for a model that includes factor or character predictors includes the levels of a factor or unique values of a character predictor in the $xlevels component of the object, but not the FALSE/TRUE values
2004 Oct 12
1
lm#contrasts#one level in factor: bug or feature
(R.1.9.1; win2000) Since it's about the tenth time I had to write an "if" around this to catch the error ... Let's look at the line myfit<-lm(res~groupvar,data=Data) Here res is of numeric type and groupvar is a factor. On first sight, it would be logical that if groupvar had only one (single) level we would get: Error in "contrasts<-"(`*tmp*`, value =
2003 Sep 16
2
can predict ignore rows with insufficient info
I need predict to ignore rows that contain levels not in the model. Consider a data frame, "const", that has columns for the number of days required to construct a site and the city and state the site was constructed in. g<-lm(days~city,data=const) Some of the sites in const have not yet been completed, and therefore they have days==NA. I want to predict how many days these sites
2009 Feb 26
1
using predict method with an offset
Hi, I have run into another problem using offsets, this time with the predict function, where there seems to be a contradiction again between the behavior and the help page. On the man page for predict.lm, it says Offsets specified by offset in the fit by lm will not be included in predictions, whereas those specified by an offset term in the formula will be. While it indicates nothings about