Displaying 20 results from an estimated 2000 matches similar to: "Lattice to ggplot2: Reference graphics across facets"
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
Hello,
Inline.
?s 19:03 de 12/06/2024, Yuan Chun Ding via R-help escreveu:
> I am sorry that I know I should provide a dataset that allows to replicate my problem.
>
> It is a research dataset and quite large, so I can not share.
>
> Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking.
> I
2013 Apr 03
5
Can package plyr also calculate the mode?
I am trying to replicate the SAS proc univariate in R. I got most of the
stats I needed for a by grouping in a data frame using:
all1 <- ddply(all,"ACT_NAME", summarise, mean=mean(COUNTS), sd=sd(COUNTS),
q25=quantile(COUNTS,.25),median=quantile(COUNTS,.50),
q75=quantile(COUNTS,.75),
q90=quantile(COUNTS,.90), q95=quantile(COUNTS,.95),
q99=quantile(COUNTS,.99) )
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
Hi Rui,
Thank you very much!
Yes, I verified using real data, it worked correctly as expected after adding tidyr:: to the pivot_longer function and dplyr:: to the group_by and summarize
Function.
I did not know how to assign the tidyr and dplyr to the three functions because I do not really understand well the three functions and just got the code from a google search.
I also tried your
2008 Jun 19
1
PrettyR (describe)
#is there a way to get NA in the table of descriptive statistics instead of
the function stopping Thank you in advance
#data
x.f <- structure(list(Site = structure(c(9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L), .Label = c("BC", "HC", "RM119", "RM148", "RM179",
"RM185",
2009 Feb 27
2
Adjusting confidence intervals for paired t-tests of multiple endpoints
Dear R-users,
In a randomized placebo-controlled within-subject design, subjects recieved
a psycho-active drug and placebo. Subjects filled out a questionnaire
containing 15 scales on four different time points after drug
administration. In order to detect drug effects on each time point, I
compared scale values between placebo and drug for all time conditions and
scales, which sums up to
2007 Jan 25
1
summary of the effects after logistic regression model
Dear all, my aim is to estimate the efficacy over time of a treatment for
headache prevention. Data consist of long sequences of repeated binary
outcomes (1 if the subject has at least 1 episode of headache , 0
otherwise) on subjects randomized to placebo or treatment.
I have fit a logistic regression model with Huber-White cluster sandwich
covariance estimator.
I have put in the model the
2008 Jul 06
2
Error: cannot use PQL when using lmer
> library(MASS)
> attach(bacteria)
> table(y)
y
n y
43 177
> y<-1*(y=="y")
> table(y,trt)
trt
y placebo drug drug+
0 12 18 13
1 84 44 49
> library(lme4)
> model1<-lmer(y~trt+(week|ID),family=binomial,method="PQL")
Error in match.arg(method, c("Laplace", "AGQ")) :
'arg' should be one of
2010 Aug 15
1
Paired t-tests
Hello List,
I'm trying to do a paired t-test, and I'm wondering if it's consistent
with equations. I have a dataset that has a response and two
treatments (here's an example):
ID trt order resp
17 1 0 1 0.0037513592
18 2 0 1 0.0118723051
19 4 0 1 0.0002610251
20 5 0 1 -0.0077951450
21 6 0 1 0.0022339952
22 7 0 2
2024 Jun 12
3
my R code worked well when running the first 1000 lines of R code
Hi R users,
The following code worked well to summarize four data groups in a dataframe for three variables (t_depth, t_alt_count, t_alt_ratio), 12 columns of summary, see attached.
However, after running another 2000 lines of R codes using functions from more than 10 other R libraries, then it only generated one column of summary.
Do you know why?
Thank you,
Yuan Chun Ding
summary_anno1148ft
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
I am sorry that I know I should provide a dataset that allows to replicate my problem.
It is a research dataset and quite large, so I can not share.
Both Bert and Tim guessed my problem correctly. I also thought about the conflicting issue between different packages and function masking.
I just hope to that someone has similar experience, so providing me suggestion.
For conflicting issue,
2013 Sep 13
1
Creating dummy vars with contrasts - why does the returned identity matrix contain all levels (and not n-1 levels) ?
Hello,
I have a problem with creating an identity matrix for glmnet by using the
contrasts function.
I have a factor with 4 levels.
When I create dummy variables I think there should be n-1 variables (in this
case 3) - so that the contrasts would be against the baseline level.
This is also what is written in the help file for 'contrasts'.
The problem is that the function
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
I sometimes think people on this list are quite rude to posters.
I'm afraid I'm likely to join in with some rudeness?
1. "Here is some code that works but also doesn't" is probably not going to
get you an answer
2. I provide no information about the data it works on or doesn't
3. I tell you I'm using a load of dependencies, but don't tell you what
4. I refer to
2010 Nov 13
0
using if statment and loops to create data layout of recurrent events
Hi ,
I have a data set with recurrence time (up to four) of myocardial infarction
(MI).
Part of the file is showing below:
Num1 Trt Sex Time T1 T2 T3 T4
1011 1 1 9
1211 0 1 59
3020 1 2 14 3
1245 0 1 18 12 16
3069 1 2 26 6 12 13
2051 0 1 53 3 15 46 51
The data consist of the following eight variables:
Num1 , patient number
Trt, treatment group (1=placebo and 2=drug)
Sex,
2012 Nov 26
1
Plotting an adjusted survival curve
First a statistical issue: The survfit routine will produce predicted survival curves for
any requested combination of the covariates in the original model. This is not the same
thing as an "adjusted" survival curve. Confusion on this is prevalent, however. True
adjustment requires a population average over the confounding factors and is closely
related to the standardized
2011 Mar 31
1
Assign Names of columns in data.frame dinamically
Hello List.
I have many files of ECG, each one with 7 column and I need only the
second column and the name of each ECG. I am doing this but althought
I have various days trying this i haven't gotten, so I ask help with
this, if somebody cans help me I'll be so thankfully.
--------------------------------------------------------------------------------------------------------
2007 Jun 28
1
Changing graphics height when using grid and lattice
Hi,
I have recently been playing with the grid package in an attempt to create
some pages containing multiple lattice plots on the same page. However, when
I specify a grid layout with different widths, such as:
pushViewport(viewport(layout = grid.layout(1, 2, unit(c(2, 1), "null"))))
the individual graphs do not end up as the same height - which is a feature
I would prefer to have.
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
2009 May 05
2
problem with ggplot2 boxplot, groups and facets
I have a following problem:
The call
qplot(wg, v.realtime, data=df.best.medians$gv1, colour=sp, geom="boxplot")
works nice: for each value of the wg factor I get two box-plots (two levels in
the sp factor) in different colours, side-by-side, centered at the wg x-axis.
However, I want to separate the data belonging to different levels of the n
factor, so I add the facets option:
2006 Aug 17
1
Simulate p-value in lme4
Dear list,
This is more of a stats question than an R question per se. First, I
realize there has been a lot of discussion about the problems with
estimating P-values from F-ratios for mixed-effects models in lme4.
Using mcmcsamp() seems like a great alternative for evaluating the
significance of individual coefficients, but not for groups of
coefficients as might occur in an experimental design
2007 Feb 20
0
Standardized residual variances in SEM
Hello,
I'm using the "sem" package to do a confirmatory factor analysis on data
collected with a questionnaire. In the model, there is a unique factor G
and 23 items. I would like to calculate the standardized residual
variance of the observed variables. "Sem" only gives the residual
variance with the "summary" function, or the standardized loadings with
the