Dear Xochitl,
Have a look at gls() from the nlme package. It allows you to fit auto
correlated errors.
gls(k ~ NPw, correlation = corAR1(form = ~ Time))
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie
Dear Molly,
Is the package in which the data is stored loaded in the Rmd? If not try
library(yourPackage)
data(yourData)
or
data(yourData, package = yourPackage)
If this doesn't solve your problem, please provide a minimal reproducible
example of the problem.
Best regards,
Thierry
ir.
: Tom Wright [mailto:t...@maladmin.com]
Verzonden: woensdag 7 januari 2015 15:43
Aan: ONKELINX, Thierry
CC: R. Help
Onderwerp: Re: [R] ggplot with sparse layout
Thanks, this is pretty good. Unfortunately I made an error in generating the
sample dataframe, this code better represents the situation
Dear Tom,
Does ggplot(data,aes(x=x,y=y))+geom_point(aes(color=group))+facet_wrap(~group +
id) gives what you need?
Note that facet_grid by design aligns the subplots into rows and columns with
the same level.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek /
Dear John,
R-sig-mixed-models is more suited for this kind of questions. All follow-up
mail should be posted only to that mailing list.
It seems like varIdent() by default relevels the grouping factor and that the
user cannot control this.
Best regards,
ir. Thierry Onkelinx
Instituut voor
You are looking for the round_date(), floor_date() or ceiling_date() functions
from the lubridate package. Those functions can round timestamps to weeks.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team
Dear Thomas,
list.files() will be your new best friend.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525
Dear Petr,
You need to use aes_string() instead of aes().
The.cols - colnames(data)[n:m]
for (i in The.cols) { p-ggplot(data, aes_string(x=x, y= i, colour=f))),
...}
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team
No that is not a bug. You are confusing order() with sort(). Please do read the
helpfiles.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Dear Guido,
Do you know how the gdb is stored? I had problems reading for a gdb on our
networkdrive. Reading from a local copy worked. It turned out that the original
copy on the networkdrive was indexed. Reading an unindexed gdb from the
networkdrive was no problem.
Best regards,
ir.
You want na.action = na.exclude. Or remove rows with NA values from your
dataset. Which is IMHO the safest way to build a model.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality
...@gmail.com]
Verzonden: dinsdag 21 oktober 2014 11:35
Aan: ONKELINX, Thierry
CC: r-help
Onderwerp: Re: [R] Dealing with NAs in lm or gmm
I tries na.action = na.exclude but it returns a fitted vector with NAs
removed.
Is there any way to return the fitted vector with NAs (In my case, 94*1 matrix)?
gmm8-gmm
Dear Barry,
You have to rethink the input format. This is easy if you use a matrix.
A - cbind(A_01, A_02, A_03, A_04)
index - cbind(seq_along(VFD_ID), VFD_ID)
A[index]
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team
You are using ggplot2 very inefficiently. Many geom's plot only one data point.
You can combine several of them in a single geom. Have a look at this gridExtra
package which has some useful functions like grid.arrange and tableGrob.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en
It is possible to do without loops if you start by calculating the totals. Then
is just aggregating and merging data.
Best regards,
Thierry
set.seed(21)
n.country - 5
average.price - runif(n.country, max = 200)
price - expand.grid(
Product = 1:10,
Country =
It is ggplot (double G), not qqplot (double Q)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Dear Adam,
ggsave() works only with single ggplot object. You need the standard R way of
saving those plots.
1) open a suitable device
2) plot the figures
3) close the device
tiff(filename = Figure 1.tiff, scale = 1, width = 10, height = 5, units =
cm, dpi = 300)
grid.arrange(plot1, plot2,
R works faster if you can avoid loops the loops. There is an example. Note that
it required global variables (like your function). You better avoid that.
rspat - function(rhox, rhoy, s2e = 1){
require(matlab)
R - s2e * eye(N)
i - rep(seq_len(N), each = N)
j - rep(seq_len(N), N)
j - j[j
Have a look at the multcomp package. The examples in glht() demonstrate how to
specify the required contrasts.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality
Here is my solution.
falses - which(!x)
first.false - head(falses, 1)
last.false - tail(falses, 1)
which(x[first.false:last.false]) + first.false - 1
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie
Another option is the plyr package.
library(plyr)
result - dlply(size, ~ Year +Season, function(.sub){
with(.sub, smooth.spline(Size, Prop, spar = 0.25))
}
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie
2014 22:13
Aan: ONKELINX, Thierry; r-packages-ow...@r-project.org; r-help@r-project.org;
r-help-requ...@r-project.org
Onderwerp: Re: [R] stop a function
Hi,
Another problem arised now. I got this error:
Error in match(x, table, nomatch = 0L) : reached CPU time limit
I googled it but nothing could
Have a look at evalWithTimeout() from the R.utils package
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525
Dear Craig,
It is better to ask questions about lme4 at r-sig-mixed-models (in cc).
Are you using a recent version of lme4? Try upgrading lme4 and see if you still
get the error.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
Dear Caroline,
Check the homogeneity of the variances. If they are inhomogeneous, you can add
a variance function to deal with it. However, you will need to switch to the
lme() from the nlme package.
Best regards,
Thierry
PS R-Sig-mixed-models is a better list for this kind of questions.
You have no missing data. Note that the string is not missing! You need to
code missings as NA. Have look at ?is.na
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Have a look at the knitr package. http://yihui.name/knitr/demo/minimal/
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Dear Michael,
You can use geom_smooth directly.
ggplot(pred, aes(x = Age, y = Better)) + geom_smooth(method = glm, family =
binomial)
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg /
This is workaround by defining the 'global variables' as NULL. Use it with
caution.
### Fooling R CMD check
transition_group_id - NULL
### Fooling R CMD check
setkey(aligtable,transition_group_id,align_origfilename)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research
Dear all,
Consider the simpel RMarkdown file below. I've saved it as test.md with UTF-8
encoding. Notice that I have embedded a custom pandoc variable 'test' in the
file. This variable holds an UTF-8 character ©.
%My title
%The authorslist
!--pandoc
format: latex
V: test:Copyright notice. ©
Dear Violette,
Search for elliptical Fourier analysis. RSiteSearch(elliptical fourier
analysis)
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Dear Michael.
The normality of _covariates_ is seldom relevant. The relevance of normality of
the _response variable_ depends on the model assumptions. In case of linear
models the only the **residuals** (and not the responses) are assumed to be
normally
distributed.
Transformation of
Both are functions (not packages) and available in the stats package.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02
Dear Kristi,
You could do something like this.
ggplot(dat1, aes(x = factor(site), y = Present)) +
geom_boxplot(aes(colour = layer)) +
geom_line(data = dat2, aes(group = 1, y = present)) +
geom_point(data = dat2, aes(y = present))
Note that
- ggplot provides no second axis
- the boxplots
Dear Dan,
Have a look at ggplot2. It allows to define themes. I've create two theme for
our institution: one according our internal styling guide, one according to the
styling guide for Elsevier journal. Applying the Elsevier theme to all plots in
a script requires just adding
You want
y - ifelse(x == 'a', 1, 2)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Dear Michael,
Calculate the propotions. Then it is easy to use the weight option of glm
data(SpaceShuttle, package=vcd)
SpaceShuttle$trials - 6
fm - glm(cbind(nFailures, 6 - nFailures) ~ Temperature, data = SpaceShuttle,
family = binomial)
fm2 - glm(nFailures/trials ~ Temperature, data =
Van: Michael Friendly [frien...@yorku.ca]
Verzonden: dinsdag 17 december 2013 19:42
Aan: ONKELINX, Thierry; R-help
Onderwerp: Re: [R] ggplot2: stat_smooth for family=binomial with cbind(Y,
N) formula
Thanks very much for this helpful reply, Thierry
Using aes(weight=trials
Dear Benedetta,
I think you might want (1+T+Z|subject) as random effects rather than
(1+T|subject) + (1 + Z|subject). The latter has two random intercepts per
subject: a recipe for disaster.
Follow-up posts should only go to the mixed models mailing list which I'm
cc'ing.
Best regards,
ir.
Dear Catalin,
Have a look at the plyr package.
library(plyr)
dlply(
eg,
.(Exp),
function(x) {
aov(masa.uscat.tr~Clona,data=x)
}
)
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Have you tried dput(your.matrix)?
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
You don't need a loop nor a growing object.
data(mtcars)
mtcars
mtcars[seq(1, nrow(mtcars), by = 2), ]
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070
You'll need to add quotes
MyAnova$Pr(F)
Or use the bracket notation
MyAnova[, Pr(F)]
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Dear Harold,
An easy work-around would be to pass the names of the variables as a character
vector.
fm - lm.eiv(y ~ x1 + x2, dat, ind = c(2,3), semDep = 0, semMat = c(sem1,
sem2))
And the change your lm.eiv.fit accordingly.
Or you could have a look at the .() function of the plyr package.
You have to escape the underscore
\Sexpr{gsub(_, \_, print(version$platform))}
Best regards,
Thierry
Van: r-help-boun...@r-project.org [r-help-boun...@r-project.org] namens David
Epstein [david.epst...@warwick.ac.uk]
Verzonden: maandag 2 september 2013
I think you want the UsingR package
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
You've misplaced the comma.
mysample - df[, sample(ncol(df), 50, replace=FALSE)]
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+
Dear Robert,
(1|A/B) is shorthand for (1|A) + (1|A:B)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43
Dear Katherine,
Combine both outputs in a list and return that.
return(list(first = output.1, second = output.2))
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality
Dear Jannis,
I think you want \link[package]{function} instead of
\link[package:function]{function}
\link[Rssa]{ssa}
Best regards,
Thierry
Van: r-help-boun...@r-project.org [r-help-boun...@r-project.org] namens Jannis
[bt_jan...@yahoo.de]
Verzonden:
Dear Stathis,
I recommend that you try to get some advice from a local statistician or read
an introductory book on statistics. This kind of question is beyond the scope
of a mailing list.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for
Dear John,
Use xlim() and ylim() instead of expand_limits()
library(ggplot2)
#sample data from ggplot2
data(Cars93, package = MASS)
dataSet - Cars93
#variables to calculate the range to extend the axis dataVector -
unlist(dataSet[,MPG.city])
dataRange - diff(range(dataSet$MPG.city))
Dear Sibylle,
Have you tried to create a new variable?
ME$fDiversity - factor(ME$Diversity)
H08_lme - lme(
log(Height2008_mean) ~ fDiversity,
data = ME,
random = ~ 1|Plot/SubPlot,
weights = varPower(form = ~Diversity),
na.action = na.omit,
subset = ME$Species == Ace_pse,
method = ML
)
Try rescaling your data prior to splitting it up into a training and test set.
Otherwise you end up with two different ways of scaling.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics
Dear all,
I am running the same model on several datasets, each dataset is a different
species. The problem is that for some datasets the model is not converging.
Currently I have an INLA model running for 35 days and still no results. The
process still uses near 100% of the CPU and less than
...@gmail.com] Namens
Henrik Bengtsson
Verzonden: donderdag 18 juli 2013 12:43
Aan: ONKELINX, Thierry
CC: r-help@r-project.org
Onderwerp: Re: [R] stopping functions with long execution times
See evalWithTimeout() of R.utils, e.g.
tryCatch({
evalWithTimeout({
slowFunction();
}, timeout=7*24*3600
Dear Eliza,
If you have the coordinates of the stations you can use the nnwhich() function
from the spatstat package.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality
Have a look at the warning in ?geepack::geeglm It should be mentioned in
?geepack::geese as well.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070
Dear John,
According to the Rstudio website you need the latest version of Rstudio to work
with R 3.0.0. I had the same problem yesterday (on WinXP). Installing the
latest Rstudio solved it.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for
FAQ 7.31
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
thierry.onkel...@inbo.be
www.inbo.be
To
Dear Eliza,
You question is not very clear. I think you are looking for the which()
function.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Dear Anna,
Is this what you would like?
Summ - ddply(mydata, .(factor3,factor1), summarize,
mean = mean(var1, na.rm = FALSE),
sdv = sd(var1, na.rm = FALSE),
se = 1.96*(sd(var1, na.rm=FALSE)/sqrt(length(var1
Summ$Grouping
Have a look at bpy.colors()
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Have a look at cast() from the reshape package.
library(reshape)
cast(personId ~ law, data = testdata, value = article, fun = length)
cast(personId ~ law, data = testdata, value = article, fun = function(x){1 *
(length(x) 0)})
Van:
I think you want %in%
subpool %in% pool
pool %in% subpool
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32
You have two options.
Q[, 117:ncol(Q)]
Or using the negation, thus not selecting the first 116 cols.
Q[, -1:-116]
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Dear all,
I'm having troubles migrating a large matrix from one system to another.
#system 1: Ubuntu 12.04, 64-bit, running R 2.15.2
# do some simulations
# save the simulations
save(Output, file = Simulations.Rdata)
#Output is a numeric matrix with 6 columns and about 2M rows.
Use ftp to
Dear Chad,
Did you post your entire dataset? If so:
1) your model is too complex for the amount of data you have. See the quotes
below...
2) There is complete separation, leading to large parameter estimates and fits
very close to 0 and 1 (in terms of probabilities)
3) You fit temperature as a
Dear all,
Thanks to Marc and Bart for looking in to this. It turns out to be due to a
typo of me: I misspelled channel.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team
Dear all,
I'm trying to connect to an MSAccess database (ArcGIS personal geodatabase). I
keep getting an error about the channel when using sqlQuery(). However,
sqlTables() does not complain about the channel and lists all tables in the
database. If I try sqlFetch(), then R crashes.
I'm happy
You can use combn(100, 2) to generate the combinations of the plots.
It is not clear to me what you want to do with the diameters. You have 4
diameter for plot 1 and 2 for plot 2. What should the output look like?
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute
Please be more specific about what you want. Give an example of the required
output. And keep the mailing list in cc when replying.
Van: catalin roibu [catalinro...@gmail.com]
Verzonden: woensdag 14 november 2012 17:54
Aan: ONKELINX, Thierry
Onderwerp: Re: [R
[mailto:spinelilouki...@gmail.com]
Verzonden: vrijdag 9 november 2012 12:06
Aan: Jose Iparraguirre
CC: ONKELINX, Thierry; r-help@r-project.org help
Onderwerp: Re: [R] A panel of contour plots through a iteration process
Hm, the problem is a little bit more complicated than I thought. Let me give
you more
Dear Yulia,
When you have an interaction between a continuous and a categorical variable,
then the multiple comparison on the categorical variabel makes only sense
conditional that the continuous variable is zero. Hence the warning.
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor
I would rather use facet_wrap() instead of multiplot()
Just combine all your data in one data.frame and make sure that you have a
variable indication the iteration.
library(reshape2)
volcano3d - melt(volcano)
names(volcano3d) = c(x, y, z)
volcano3d - merge(volcano3d, data.frame(Iteration =
http://scholar.google.be/scholar?q=www.R-project.orgbtnG=hl=nlas_sdt=0
http://scholar.google.be/scholar?q=%22R+Core+Team%22btnG=hl=nlas_sdt=0
http://scholar.google.be/scholar?q=%22R+Foundation+for+Statistical+Computing%22btnG=hl=nlas_sdt=0
ir. Thierry Onkelinx
Instituut voor natuur- en
bericht-
Van: Bert Gunter [mailto:gunter.ber...@gene.com]
Verzonden: maandag 5 november 2012 16:13
Aan: D. Rizopoulos
CC: ONKELINX, Thierry; r-help@r-project.org
Onderwerp: Re: [R] averaging a list of matrices element wise
Gents:
Although it is difficult to say what may be faster, as it typically
Dear all,
I have a list of n matrices which all have the same dimension (r x s). What
would be a fast/elegant way to calculate the element wise average? So result[1,
1] - mean(c(raw[[1]][1, 1] , raw[[2]][1, 1], raw[[...]][1, 1], raw[[n]][1, 1]))
Here is my attempt.
#create a dummy dataset
n -
Dear Adrienne,
What is the output of summary(casestudy) and summary(gridmeta)?
What happens if you set nmax to 10?
krige(formula=bias~1,locations=~lon+lat,data=casedata,newdata=gridmeta
,model=v.fit, nmax = 10)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute
Dear Sylvia,
R-sig-mixed-models is a better list for questions about mixed models.
The summary gives you the standard error for the fixed effects. See the output
in your mail. E.g. AGQ has a standard error of 0.044
Have a look at http://glmm.wikidot.com/faq, it covers some topics on mixed
You first example is a list of 5 items, each item is a number
The second example is a list with one item: a vector with 5 elements.
You'll need c() to make a vector of the item to get the same result.
all.equal(list(c(0.8,0.9,1.0,1.1,1.2)), list(seq(0.8, 1.2, by = 1.1)))
ir. Thierry Onkelinx
Have a look at
library(sos)
findFn(twice filter)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54 43 61 85
Dear Johan,
Why should it be complicated? You have a very simple model, thus a very simple
formula. Isn't that great?
Your formula matches the model. Though Trust~Culture + Structure *
Speed_of_Integration is another option. The model fit is the same, the only
difference is the
How about this?
Andpleasemakeusofthelargekeyatthebottomofyourkeyboard.Itmakescodemuchmorereadable.
library(ggplot2)
spd - factor(c(s,f,f,s,f,s,s,s,f,f,s,f))
r - c(4.9,3.2,2.1,.2,3.8,6.4,7.5,1.7,3.4,4.1,2.2,5)
dataset - data.frame(spd, r)
dataset - rbind(cbind(dataset, Type = DOE, delta = 2),
Dear Babs,
This is how I would present the model, if I had enough data to support the
model. The model is too complicated for your data and leads to a perfect fit.
Is this the aggregated dataset, or does your design has no replicates?
Best regards,
Thierry
dataset$combinatie -
Dear Laurent,
An R proces uses only one core. It is possible to use multiple cores. Have a
look at he Hig-Performance and Parallel Computing task view
(http://cran.freestatistics.org/web/views/HighPerformanceComputing.html)
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en
You can use a combination of the outer() and apply() functions
n - 10
p - 9
dataset - data.frame(matrix(rep(seq_len(p), each = n), nrow = n, ncol = p))
colnames(dataset) - paste(p, seq_len(p), sep = )
test - t(apply(dataset, 1, function(x){ x %o% x}))
colnames(test) - paste(p, rep(seq_len(p),
Dear Christof,
You want the predict() function. See ?predict.lme for the details.
Best regards,
Thierry
PS Questions on lme() can be asked at r-sig-mixed models.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie
Dear Helios,
I think you rather want a mixed model with shoe as random effect.
library(lme4)
lmer(Y ~ Ground + (1|Shoe)) #the effect of shoe is independent of the ground
effect
or
lmer(Y ~ Ground + (0 + Ground|Shoe)) #the effect of shoe is different per
ground.
Best regards,
Thierry
ir.
Is this homework? If it is, please read the posting guide.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2 525 02 51
+ 32 54
Dear John,
R-sig-mixed-models is a better list for this kind of questions.
It looks like the model finds no evidence for a random slope. Notice the very
small variance of the random slope. In the model without random intercept, the
random slope tries to mimic the effect of a random intercept.
Just use the logical operators.
Counts - c(1,0,21,2,0,0,234,2,0)
Counts 0
1 *(Counts 0)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Dear Alex,
I'm cc'ing this to the mixed models list which is more appropriate for the
question. Please send all follow up posts only to that list.
First a few more general remarks.
- You are using the data argument of glmmPQL. So there is no need to attach()
the data.frame. I recommend avoid
Please give a reproducible example when making bold statements.
I find no evidence of autocorrelation in
set.seed(12345)
x - rnorm(100, mean = 0, sd = 1)
acf(x)
x - rnorm(1e6, mean = 0, sd = 1)
acf(x)
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
offset() fixes the parameter to 1. So offset(I(.5*X2)) should do the trick.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance
Kliniekstraat 25
1070 Anderlecht
Belgium
+ 32 2
You'll need to pass the data as a vector.
mean(16, 18) is asking the mean of 16. 18 is passed to the second argument
which is trim. So you are doing mean(16, trim = 18)
What you want is
mean(c(16, 18))
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek /
You can achieve that with a combination of as.formula and paste.
library(nlme)
data(petrol, package = MASS)
lme(as.formula(paste(Y.VAR, ~EP)), random= ~1|No, data=petrol)
Best regards,
Thierry
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Dear Robert,
It is easier to use lm instead of aov if you want coefficients for each group.
Note that you can use rnorm vectorised.
set.seed(0)
N - 100 # sample size
MEAN - c(10, 20, 30, 40, 50)
VAR - c(20,20,1, 20, 20)
LABELS - factor(c(A, B, C, D, E))
# create a data frame with labels
df -
Dear nameless,
A mixed model seems reasonable for your kind of data. lme() from nlme or lmer()
from lme4 are good starting points.
Please note that there is R-sig-mixed-models: a R mailing list dedicated to
mixed models.
Best regards,
ir. Thierry Onkelinx
Instituut voor natuur- en
From the posting guide of this mailing list: Basic statistics and classroom
homework: R-help is not intended for these.
Ask your fellow students or your teacher.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and
Forest
team Biometrie
1 - 100 of 593 matches
Mail list logo