Displaying 20 results from an estimated 8000 matches similar to: "Wrong df in bartlett.test when subsetting data (PR#1124)"
2003 May 13
1
qt(p,df) discontinuous in p for df in 1.01->1.7 (PR#2991)
Full_Name: Jens Lund
Version: Version 1.7.0 (2003-04-16)
OS: Win NT 4.0 SP 6
Submission from: (NULL) (193.3.225.210)
As the T distribution is symmetrical around 0 qt(0.5,df) should return 0 for any
df.
However for df close to 1 it seems to have problems as seen by:
qt(0.5,seq(1,1.1,by=0.0001))
For example:
> qt(0.5,1.01)
[1] -0.2300470
Higher df as df=1.1 (and up to approx df=1.7) seem
2007 Aug 01
1
Problem to remove loops in a routine
Dear R-users,
I have written the following code to generate some trellis plots. It
works perfectly fine except that it is quite slow when it is apply to my
typical datasets (over several thousands of lines). I believe the
problem comes from the loops I am using to subset my data.frame. I read
in the archives that the tapply function is often more efficient than a
loop in R. Unfortunately ,
2008 Apr 28
1
error in summary.Design
Dear list,
after fitting an lrm with the Design package (stored as "mymodel") I
try running a summary, but I get the following error:
dim(mydata)
[1] 235 9
names(mydata)
[1] "id" "VAR1" "VAR2" "VAR3" "VAR4" "VAR5" "VAR6" "VAR7" "VAR8"
summary(mymodel)
Error in `contrasts<-`(`*tmp*`,
2003 Jan 03
1
Take care with codes()! (was type of representation)
Ahh yes, sorry about that.
Here's the corrected snippet:
# Create an Example Data Frame Containing Car x Color data
carnames <- c("bmw","renault","mercedes","seat")
carcolors <- c("red","white","silver","green")
datavals <- round(rnorm(16, mean=10, sd=4),1)
data <- data.frame(Car=rep(carnames,4),
2005 Jan 27
1
Is glm weird or am I?
Hi,
I've written a script that checks all bivariate correlations for
variables in a matrix. I'm now trying to run a logistic regression on
each pair (x,y) where y is a factor with 2 levels. I don't know how (or
whether I want) to try to fathom what's up with glm.
What I wrote is attached. Here's what I get.
*****************************************************
2007 Aug 06
3
Error in using nlevels in apply function
Dear R users,
I am currently trying to create my first personnal function and use it
with the apply function. The purpose of this function is to create a
vector summarizing the number of levels in a given selection of
data.frame columns.
I tried to transpose the indexation method used by the nlevels function
but it doesn't seem to work. I did not find anything uesful in the
archives so
2011 Jun 14
1
Expand DF with all levels of a variable
Dear list,
I would like to expand a DF with all the missing levels of a variable.
a <- c(2,2,3,4,5,6,7,8,9)
a.cut <- cut(a, breaks=c(0,2,6,9,12), right=FALSE )
(x <- data.frame(a, a.cut))
# In 'x' the level "[0,2)" is "missing".
AddMissingLevel <- function(xdf) {
xfac <- factor( c("[0,2)", "[2,6)", "[6,9)",
2011 Dec 22
1
overlaid filled contour plots
I'm trying to make a set of contour plots of bivariate kernel density
estimates, showing three such plots overlaid,
similar to this plot
http://euclid.psych.yorku.ca/SCS/Private/Test/ridge-boot2.pdf
except that I would like to have the contours *filled* (using
transparent colors). To make this reproducible, I've
saved the results of KernSmooth::bkde2D() in the following file:
2011 Mar 19
2
persuade tabulate function to count NAs in a data frame
Hi,
I'd like to ask you a question again. It is basically about data frames, NAs and tabulate function.
I have this data frame. I already used this in one of the previous questions of mine. It intentionally looks this simple, my real 'df' dataframe is much bigger actually and again, I am not willing to annoy anyone with huge databases... So, my database:
id
2005 Nov 23
1
assign() problem
I've written a piece of code (see below) to do a wavelet image
decomposition, during the evaluation of this code I would like to write
the results of some calculations back to the R root directory. I used
assign() to do so because the names should vary when going thrue a
while() loop. For some unknown reason I get an error that says:
Error in assign(varname[i], imwrImage) :
2007 Jul 30
1
correlation and matrix
Dear everyone,
I am new in R and I've got difficulties in realizing the following
tasks:
-I have variables (factors) with different numbers of levels, either 1,
2 or 3.
-I have a matrix containing these 204 factors and I have to correlate
them by groups of 4 variables.
-I have to delete the factors just having one level ( because when
correlating one-level factors, the output is NA)
here
2012 Feb 09
2
Lattice 3d coordinate transformation
Hello List!
I asked this before (with no solution), but maybe this time... I'm
trying to project a surface to the XY under a 3d cloud using lattice.
I can project contour lines following the code for fig 13.7 in
Deepayan Sarkar's "Lattice, Multivariate Data Visualization with R",
but it fails when I try to "color them in" using panel.levelplot.
?utilities.3d says there
2013 Jan 16
1
setting the legend scale in contour plots
Hi,
I'd like to compare SST data for year 2000 with SST for year 2001. I managed
to get filled contour plots showing monthly SST for both years (12 plots for
each year, 24 plots in total). In order to compare year 2000 and year 2001,
however, I'd need to have the same legend scale (same color bar) in both
years plots.
Thus, my question is: is there a way to set the legend scale in
2009 Dec 10
2
different randomForest performance for same data
Hello,
I came across a problem when building a randomForest model. Maybe someone can help me.
I have a training- and a testdataset with a discrete response and ten predictors (numeric and factor variables). The two datasets are similar in terms of number of predictor, name of variables and datatype of variables (factor, numeric) except that only one predictor has got 20 levels in the training
2009 Aug 21
1
Panel Data Analysis (PLM) - Fixed Effects - "cannot allocate vector of length"
Hello to all on the list,
I'm trying to estimate a fixed effects model from a large (unbalanced) panel
data set.
I have no problems when using only an individual effect or only a time
effect, but I get an error message when I try for a "twoways" effect. Here
is some of the code:
paneldata27 is the entire panel data set:
> dim(paneldata27)
[1] 1178831 8
>
2010 Oct 22
1
Problem with Aggregate - Sum, limit on number of criteria
Hello,
It appears there is a limit in the number of criteria that can be put into
the Aggregate sum function. (It looks like it is 32).
My code is;
HSfirst=aggregate(count,
2005 Aug 23
1
how to (combine / recode / merge) two factor.
Hi,
I have a data frame with two factors, and I would like to create a new
one by "combining" them.
I have already a solution, but it is very "heavy", and I'm sure there is
a basic function which can do the same.
I tried to find it in the R-help, but without result.
See the example :
# just to create a dataframe
f1 <- factor(rep(c("A","B"),3))
f2
2012 Sep 19
2
Help reproducing a contour plot
Hi All,
I am trying to reproduce this using R instead.
[image: Full-size image (38 K)]
I tried using the following code
*SChla <- read.csv("SM_Chla_data.csv")*
*Atlantis <- SChla[16:66,]*
*head(Atlantis)*
*
*
Seamount Station Depth Pico Nano Micro Total_Ch dbar Latitude
Longitud
16 Atlantis 1217 Surface 0.0639 0.1560 0.0398 0.2597 2.082 -32.71450
57.29733
2010 Aug 03
4
REmove level with zero observations
If I have a column with 2 levels, but one level has no remaining
observations. Can I remove the level?
Had intended to do it as listed below, but soon realized that even though
there are no observations, the level is still there.
For instance
summary(dbs3.train.sans.influential.obs$HAC)
yields
0 ,1
4685,0
nlevels(dbs3.train.sans.influential.obs$HAC)
yields
[1] 2
drop.list <- NULL
2007 Oct 02
1
splom pairs and groups argument
Hello,
I'm trying to pull off a certain graph using splom, and can't quite get my panel functions right.
Basically, the equivalent using pairs would be something like this (using iris data set as an example):
panel.corval <- function(x, y, digits=2, prefix="", cex.cor,col,pch)
{
usr <- par("usr"); on.exit(par(usr))
par(usr = c(0, 1, 0, 1))