similar to: Nesting order for mixed models

Displaying 20 results from an estimated 10000 matches similar to: "Nesting order for mixed models"

2009 Aug 11
1
Prevent sequential repeated values in data frame column
Hi, I'm trying to randomize a sequence of trials for an experimental design. The trials consist of values for each of two factors. As is there are 30 combinations of the two factors, and I want them to be ordered randomly but with the requirement that for one of the factors, the value can never be the same as the previous value. I'm currently randomizing my dataframe by using:
2008 Nov 25
1
Strange seq() behavior
Hi, This is really strange. Can anyone help explain what's going on here (on 3 and 7)? > targets <- seq(from=.1, to=.9, by=.1) > targets[1]==.1 [1] TRUE > targets[2]==.2 [1] TRUE > targets[3]==.3 [1] FALSE > targets[4]==.4 [1] TRUE > targets[5]==.5 [1] TRUE > targets[6]==.6 [1] TRUE > targets[7]==.7 [1] FALSE > targets[8]==.8 [1] TRUE >
2011 Nov 09
2
plot separate groups with plotmeans()
Hi, I often use plotmeans() from the gplots package to quickly visualize a pattern of change. I would like to be able to plot separate lines for different groups, but the function gives an error when a grouping variable is included in the formula argument. For instance, > require(gplots) > x <- data.frame(Score=rnorm(100), Time=rep(1:10, 10),
2008 Jul 07
2
A shorter version of ".Last.value"?
Hi, There is an object, ".Last.value" to which the result of the most recent evaluation is assigned. This is similar to "ans" in Matlab. In Matlab "ans" can be very useful and time-saving, but typing the larger R version is somewhat clunky and takes away from the usefulness. Is it possible to reassign '.Last.value' to something simpler, like
2010 Apr 21
1
Adding error bars to xyplot()
Hi, I want to add error bars to a plot generated with xyplot. I've tried both errbar() and plotCI(), but in both cases the points are not in the same place. It's as if the two functions are using a different frame of reference for the plotting area. for example: means <- c(92.5, 92.25, 90.9, 91.0, 94.15, 90.05) #means time <- c(1,1,2,2,3,3) #occasion variable group <-
2012 Apr 24
1
Remove top/right border from lattice plots
Hi, I've done my best to search for a solution to this, but had no luck. How can I create a lattice plot (I'm using xyplot() ) that does not have a border on the top and right side, but keeps the bottom/left axes? So far all I've found is this, which inserted into the xyplot call removes all 4 borders: / par.settings = list(axis.line = list(col = 0))/ xyplot( Sepal.Length ~
2008 Jul 18
1
Functions similar to step() and all.effects() that work for lme() objects?
Hello, I make frequent use of the *step()* and, for plotting, *all.effects() *functions for *lm()* objects. I am now doing more with *lme()* random effects models, and haven't been able to find functions similar to *step()* or *all.effects()* which will accept *lme()* objects. Do similar functions for either exist? If someone could point me in the right direction it would be much
2010 Oct 13
4
Change global env variables from within a function
Hi, I've looked all over for a solution to this, but haven't had much look in specifying what I want to do with appropriate search terms. Thus I'm turning to R-help. In the process of trying to write a simple function to rename individual column names in a data frame, I ran into the following problem: When I rename the columns within my function, I can't seem to get it to
2011 Sep 15
1
Problems with aggregate() function in stats package
Hi, I'm having some problems with the aggregate() function in the {stats} package, and the documentation doesn't address them. 1) Why would the first line work, but the second not? According to the help file, it accepts a "data=" argument. > with(tsrc, aggregate(x=DistRatio, by=list(Condition), FUN=mean)) Group.1 x 1 Congruent 1.741789 2 Mismatch 1.771425
2008 Nov 20
1
syntax and package for generalized linear mixed models
Hi All, I am making the switch to R and uncertain which of the several packages for mixed models is appropriate for my analysis. I am waiting for Pinheiro and Bates' book to arrive via inter-library loan, but it will be a week or more before it arrives. I am trying to fit a generalized linear mixed model of survival data (successes/trials) as a function of several categorical fixed and
2011 Feb 07
2
Unbalanced Mixed Linear Models With Nested Stratum
Hi folks, I have a dataset from a trial measuring the subjects' pupils. There are many measurements, all of which must be analysed in a similar fashion; so if I get the analysis right for one of them, I've got them all. For simplicity, let us call any measurement we may be interested as "response". The study design is an unbalanced latin square, with 5 periods, 5 treatments and
2003 Jun 11
1
COX PH models for event histories?
This is a question about the use of the Cox proportional hazards model to analyze event histories. I am looking at the responses of sympathetic nervous system activity to a stimulus. The activity I observe is a burst that can only occur once per heart beat cycle (e.g., a binary count). Typically bursts occur in 60-80% of the heart cycles * sensory stimuli can modify these burst probabilities.
2018 Jan 07
1
Defining interaction in random effects in lme4
Dear everybody! My fixed-effects-only model looks like this: glmer(Accuracy ~ C.RT*Group, data = da) C.RT is the reaction time variable, and Group is a categorical variable with 0 and 1 as values. I would like to specify that main intercept, Group intercept, C.RT slope and C.RT*Group slope vary across subjects and trials. All subjects have values in Group = 0 and in Group = 1. Trials are nested
2011 Apr 22
1
Survival analysis: same subject with multiple treatments and experience multiple events
Hi there, I need some help to figure out what is the proper model in survival analysis for my data. Subjects were randomized to 3 treatments in trial 1, some of them experience the event during the trial; After period of time those subjects were randomized to 3 treatments again in trial 2, but different from what they got in 1st trial, some of them experience the event during the 2nd trial (I
2008 May 30
2
inconsistent output when using variable substitution
I am extremely puzzled by this behavior in R. I have a data frame called Trials in which I have results from an experiment. I am trying to do a subjects analysis, but getting weird results. Each row has 1 trial in it, which includes a column for the subject number I get the list of subject numbers like so: > Subj=unique(sort(Trials$Subj)) Then I loop over them. But I get strange results. As
2006 Mar 18
1
Time-Series, multiple measurements, ANOVA model over time points, analysis advice
Hi, I have some general questions about statistical analysis for a research dataset and a request for advice on using R and associated packages for a valid analysis of this data. I can only pose the problem as how to run multiple ANOVA tests on time series data, with reasonable controls of the family-wise error rate. If we run analysis at many small sections of a long time-series, the Type-I
2008 May 15
2
mixed effects models with nested factors
Hi everybody, I am trying to fit a model with the lmer function for mixed effects. I have an experimental design consisting of 5 field plots. Each plot is divided in 12 subplots where the influence of three factors on the growing of tree seedlings is tested: (1) seed (1 = presence; 0 = absence); (2) seedling species (oak holm vs. pine); (3) treatment (three different treatments). In each of
2010 Dec 15
1
Structure of Anova for obtaining sig. corrected for departure from sphericity
Dear helpers, I have a 2x2 mixed design with two "groups" (between-subjects) and two presentation-types (within-subjects). The difference between groups is in the order of manipulations: group.CD having first a block of present.type.C and then a block of present.type.D, each block containing 31 trials. group.DC having first a block of present.type.D and then a block of present.type.C,
2002 Dec 15
2
Interpretation of hypothesis tests for mixed models
My question concerns the logic behind hypothesis tests for fixed-effect terms in models fitted with lme. Suppose the levels of Subj indicate a grouping structure (k subjects) and Trt is a two-level factor (two treatments) for which there are several (n) responses y from each treatment and subject combination. If one suspects a subject by treatment interaction, either of the following models seem
2005 Dec 01
1
LME & data with complicated random & correlational structures
Dear List, This is my first post, and I'm a relatively new R user trying to work out a mixed effects model using lme() with random effects, and a correlation structure, and have looked over the archives, & R help on lme, corClasses, & etc extensively for clues. My programming experience is minimal (1 semester of C). My mentor, who has much more programming experience, but a comparable