Displaying 20 results from an estimated 2000 matches similar to: "Statistical mode"
2010 Mar 22
2
using reorder in "dotplot"
Hi ,
Name
rate
HEALTHALLIANCE HOSPITALS, INC -1.06211747
MOUNT AUBURN HOSPITAL 0.50960291
STURDY MEMORIAL HOSPITAL 2.64233232
LAWRENCE GENERAL HOSPITAL 2.15628558
CAMBRIDGE HEALTH ALLIANCE 1.23623144
I would like use
2010 Mar 03
1
How to create a line and bar panel chart with two different axes?
I need to create a line and bar panel chart with two different axes. I tried
in lattice but couldn't get it worked. Here is my code:
data(barley)
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = F,
auto.key = list(points = FALSE, rectangles = TRUE, space =
"right"),
ylab = "Barley Yield
2009 Apr 27
0
VIF's in R using BIGLM
Dear R-help
This is a follow-up to my previous post here:
http://groups.google.com/group/r-help-archive/browse_thread/thread/d9b6f87ce06a9fb7/e9be30a4688f239c?lnk=gst&q=dobomode#e9be30a4688f239c
I am working on developing an open-source automated system for running
batch-regressions on very large datasets. In my previous post, I posed
the question of obtaining VIF's from the output of
2013 Jun 25
1
F statistic in add1.lm vs add1.glm
Should the F statistic be the same when using add1() on models created by lm and glm(family=gaussian)?
They are in the single-degree-of-freedom case but not in the multiple-degree-of-freedom case.
MASS:addterm shows the same discrepancy. It looks like the deviance (==residual sum of squares) gets
divided by the number of degrees of freedom for the term twice in add1.glm. Using anova() on the
2020 Oct 18
1
Resultado de la consola como un tibble
Hola,
Bueno, puedes hacer el cálculo de una forma mucho más compacta y rápida.
Esta forma es especialmente recomendable cuando tienes muchas columnas y
muchas filas.
> library(data.table)
> myDT <- as.data.table(mtcars)
> myDTlong <- melt(myDT, measure.vars=1:ncol(myDT))
> myDTlong[ , list(p_value = shapiro.test(value)$p.value, v_stat =
shapiro.test(value)$statistic) , by
2010 Nov 30
3
pca analysis: extract rotated scores?
Dear all
I'm unable to find an example of extracting the rotated scores of a
principal components analysis. I can do this easily for the un-rotated
version.
data(mtcars)
.PC <- princomp(~am+carb+cyl+disp+drat+gear+hp+mpg, cor=TRUE, data=mtcars)
unclass(loadings(.PC)) # component loadings
summary(.PC) # proportions of variance
mtcars$PC1 <- .PC$scores[,1] # extract un-rotated scores of
2016 Apr 14
0
Bug in by() function which works for some FUN argument and does not work for others
I think you are not using the best function for what your intentions are.
Try:
> by(data=mtcars, INDICES=list(as.factor(mtcars$am)), FUN=colMeans)
: 0
mpg cyl disp hp drat wt
qsec vs
17.1473684 6.9473684 290.3789474 160.2631579 3.2863158 3.7688947
18.1831579 0.3684211
am gear carb
0.0000000
2008 Mar 05
0
Using tune with gbm --grid search for best hyperparameters
Hello LIST,
I'd like to use tune from e1071 to do a grid search for hyperparameter
values in gbm. However, I can not get this to work. I note that there is no
wrapper for gbm but that it is possible to use non-wrapped functions (like
lm) without problem. Here's a snippet of code to illustrate.
> data(mtcars) obj <-
>
2020 Jun 17
2
subset data.frame at C level
Hi,
Hope you are well.
I was wondering if there is a function at C level that is equivalent to
mtcars$carb or .subset2(mtcars, "carb").
If I have the index of the column then the answer would be VECTOR_ELT(df,
asInteger(idx)) but I was wondering if there is a way to do it directly
from the name of the column without having to loop over columns names to
find the index?
Thank you
Best
2016 Apr 15
0
Bug in by() function which works for some FUN argument and does not work for others
> On Apr 15, 2016, at 1:16 AM, Akhilesh Singh <akhileshsingh.igkv at gmail.com> wrote:
>
> Dear All,
>
> Thanks for your help. However, I would like to draw your attention to the
> following:
>
> Actually, I was replicating the Example 2.3, using the dataset
> "brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55,
> of a
2020 Oct 18
0
Resultado de la consola como un tibble
Hola,
No hace falta (en este caso) capturarlo de la consola.
El resultado de la función apply se puede capturar y procesar.
> data("mtcars")
> # Mtcars_matriz <- as.matrix(mtcars)
> res_out <- apply(mtcars, MARGIN =2, FUN = shapiro.test)
>
>
> res_df <- as.data.frame(unlist(res_out))
> res_df$vars <- rownames(res_df)
> rownames(res_df) <- NULL
2012 Nov 04
1
Apply same linear model to subset of dataframe
I have applied the same linear model to several different subsets of a
dataset. I recently read that in R, code should never be repeated. I feel my
code as it currently stands has a lot of repetition, which could be
condensed into fewer lines. I will use the mtcars dataset to replicate what
I have done. My question is: how can I use fewer lines of code (for example
using a for loop, a function or
2016 Apr 17
0
Bug in by() function which works for some FUN argument and does not work for others
> On Apr 16, 2016, at 2:03 AM, Akhilesh Singh <akhileshsingh.igkv at gmail.com> wrote:
>
> Dear All,
>
> I have got your core message, that it is my responsibility to determine whether any particular function in my version of R satisfies the language requirements at the time of your use. Jim Albert and Maria Rizzo must have used their code, which was permitted in the R-code
2013 Apr 12
3
Why copying columns of a data.frame becomes numeric?
Dear list,
I want the 1st, 2nd, 5th, and 6th columns of mtcars. After copying them,
the columns become numeric class rather than data frame.
But, when I copy rows, they data frame retains its class. Why is this? I
don't see why copying rows vs columns is so different.
> class(mtcars)
[1] "data.frame"
> head(mtcars)
mpg cyl disp hp drat wt qsec vs
2017 Aug 29
2
DBI::dbWriteTable syntax error apparently from quotes
I have been successfully using RODBC for a long time (years) to connect to
MS SQL Server from R.
This week I wanted to try using odbc but I am seeing some problems which
may be related to how I set up my driver and/or connection.
The dbWriteTable manual page gives as an example command:
dbWriteTable( pDB$con, "mtcars", mtcars[1:5,])
When I try this I get the following error
Error:
2010 Mar 31
1
strip.custom with strip on left for three conditioning variables
I want to use a strip.custom as with useOuterStrips for three conditioning
variables.
useOuterStrips restricts this to only two conditioning variables, and I
cannot figure out
how to write strip.custom properly to do this.
library(lattice)
mtcars$HP <- equal.count(mtcars$hp)
#with two factors
x2<-xyplot(mpg ~ disp | HP + factor(cyl), mtcars)
useOuterStrips(x2)
#with three factors
2017 Aug 29
0
DBI::dbWriteTable syntax error apparently from quotes
Double quotes are not legal SQL syntax. Use single quotes.
--
Sent from my phone. Please excuse my brevity.
On August 29, 2017 2:21:44 AM PDT, Eric Berger <ericjberger at gmail.com> wrote:
>I have been successfully using RODBC for a long time (years) to connect
>to
>MS SQL Server from R.
>This week I wanted to try using odbc but I am seeing some problems
>which
>may be
2016 Apr 15
4
Bug in by() function which works for some FUN argument and does not work for others
Dear All,
Thanks for your help. However, I would like to draw your attention to the
following:
Actually, I was replicating the Example 2.3, using the dataset
"brainsize.txt" given in Section 2.3.3 ("Summarize by group") at page 55,
of a famous book "R by Example" written by "Jim Albert and Maria Rizzo"
published in Springers (2012) in a Use R! Series. The
2016 Apr 16
2
Bug in by() function which works for some FUN argument and does not work for others
Dear All,
I have got your core message, that it is my responsibility to determine
whether any particular function in my version of R satisfies the language
requirements at the time of your use. Jim Albert and Maria Rizzo must have
used their code, which was permitted in the R-code of their time (2012).
Therefore, I have now modified my R-code, as per R-3..2.4 version,
according to my requirement
2020 Jun 23
0
subset data.frame at C level
It looks to me like internally .subset2 uses `get1index()`, but this
function is declared in Defn.h, which AFAIK is not part of the exported R
API.
Looking at the code for `get1index()` it looks like it just loops over the
(translated) names, so I guess I just do that [0].
[0]:
https://github.com/r-devel/r-svn/blob/1ff1d4197495a6ee1e1d88348a03ff841fd27608/src/main/subscript.c#L226-L235
On Wed,