Displaying 20 results from an estimated 300 matches similar to: "simple ts.plot question"
2011 Sep 23
1
Newbie question: Converting Table
Hi,
I'm new to R, and I have searched helpfiles and this forum on my 2
questions. Hope you guys can help me out! :-)
Many thanks in advance!
Cheers,
Lars
Q1: I imported a csv file with columnames subject and class. There are about
1000 different classes...
It looks like this:
subject1, class1
subject1, class2
subject2, class1
subject2, class3
...
subject999, class1
subject999, class2
2011 Dec 03
1
Reading multiple text files and then combining into a dataframe
I have a multiple text files, separated by a single space, that I need to
combine into a single data.frame. Below is the track I'm on using
list.files to capture the names of the files and then lapply with
read.table. But I run into problems making a usable dataframe out of the
data.
#Creating example data in similar format to data I have
sub <- rep(1,10)
trial <- seq(1,10,1)
size
2011 May 21
0
Problem with ANOVA repeated measures: "Error() model is singular"
Hello everybody,
I need an help because I donĀ“t know if the command for the ANOVA analysis I am
performing in R is correct. Indeed using the function aov I get the following error:"In aov (......) Error() model is singular"
The structure of my table is the following: subject, stimulus, condition, sex, response
Example:
subject stimulus condition sex response
2010 Oct 30
2
transforming a dataset for association analysis
Hi
I would like to transform a data frame like
Subject Item Score
Subject 1 Item 1 1
Subject 1 Item 2 0
Subject 1 Item 3 1
Subject 2 Item 1 1
Subject 2 Item 2 1
Subject 2 Item 3 0
....
*to *
Subject Item1 Item2 Item3 .....Item N
Subject1 1 0 1
Subject2 1 1 0
........
SubjectP..
Apologize for the simple nature of my query but I am stuck.
2010 Nov 01
2
transforming a dataset for association analysis RESHAPE2
I get the following message when using the reshape2 package line
> tDat.m<- melt(Dataset)
Using Item, Subject as id variables
> tDatCast<- acast(tDat.m,Subject~Item)
Aggregation function missing: defaulting to length
Note Problem Statement-
convert dataframe
Subject Item Score
1 Subject 1 Item 1 1
2 Subject 1 Item 2 0
3 Subject 1 Item 3 1
4 Subject 2 Item 1 1
5
2003 Jan 29
3
Analyzing an unbalanced AB/BA cross-over design
I am looking for help to analyze an unbalanced AB/BA cross-over design by
requesting the type III SS !
# Example 3.1 from S. Senn (1993). Cross-over Trials in Clinical
Research
outcome<-c(310,310,370,410,250,380,330,270,260,300,390,210,350,365,370,310,380,290,260,90,385,400,410,320,340,220)
subject<-as.factor(c(1,4,6,7,10,11,14,1,4,6,7,10,11,14,2,3,5,9,12,13,2,3,5,9,12,13))
2011 Dec 07
1
MIXED MODEL WITH REPEATED MEASURES
I am trying to specify a mixed model for my research, but I can't quite get
it to work. I've spent several weeks looking thru various online sources to
no avail. I can't find an example of someone trying to do precisely what I'm
trying to do. I'm hoping some smart member of this mailing list may be able
to help.
First off, full disclosure: (1) I'm an engineer by trade, so
2006 Jul 24
3
random section of samples based on group membership
Hi all,
I have a matrix of 474 rows (samples) with 565 columns (variables).
each of the 474 samples belong to one of 120 groups, with the
groupings as a column in the above matrix. For example, the group
column would be:
1
1
1
2
2
2
.
.
.
120
120
I want to randomly select one from each group. Not all the groups
have the same number of samples, some have 4, some 3 etc. Is there a
function to
2008 Apr 30
2
Summary statistics across factor levels
R users,
I intention is to calculate some summary statistics across factor
levels. I know that in Hmisc package there is a summary function which
produces neat summary statistics when using "cross" option. I would
like to produce similar output with N and Missing columns but produce
a data.frame. Is there any built-in function for that?
#example data
install.packages("Hmisc")
2001 Dec 27
3
reshape error in 1.4 (PR#1231)
Full_Name: Kevin Wright
Version: 1.4
OS: Windows 95
Submission from: (NULL) (170.54.59.160)
Note: This was the 1.4 build for Windows that Brian Ripley made available.
The first example in the help for reshape doesn't work for me. When I cut and
paste, this is what happens:
> data(Indometh,package="nls")
> summary(Indometh)
Subject time conc
2007 May 11
3
A simple question regarding plot of nls objects
Hi,
I was trying to run the example of Indomethacin kinetics from the book:
## From Pinheiro/Bates, Mixed-Effects-Models in S and S-Plus,
## Springer, Second Printing 2001, Section 6.2
library(nlme)
plot(Indometh)
fm1Indom.nls <- nls(conc~SSbiexp(time,A1,lrc1,A2,lrc2), data=Indometh)
summary(fm1Indom.nls)
plot(fm1Indom.nls,Subject~resid(.),abline=0)
## ....
the last plot command gives me the
2008 Nov 14
1
Superimposing y-variables in Lattice formulas
Given a data frame of a categorical variable and two continuous
variables, I would like to display one continuous variable against the
other for each value of the categorical variable, all superimposed on
the same plot. For example:
data(Indometh); str(Indometh)
Classes 'nfnGroupedData', 'nfGroupedData', 'groupedData' and
'data.frame': 66 obs. of 3
2001 May 23
2
help: exponential fit?
Hi there,
I'm quite new to R (and statistics),
and I like it (both)!
But I'm a bit lost in all these packages,
so could someone please give me a hint
whether there exists a package for fitting
exponential curves (of the type
t --> \sum_i a_i \exp( - b_i t))
on a noisy signal?
In fact monoexponential decay + polynomial growth
is what I'd like to try.
Thanks in advance,
2005 Jun 24
9
R demos
Hi All,
I am currently preparing some form of slideshow introducing R and its
capabilities for some colleagues. The thing will be about 30 mins, and
I'd like to have some "pretty pictures" and some "amazing facts" (I'm
trying to sell, obviously :)).
Can I ask if it's possible to easily retrieve a gross figure of the
number of functions in R considering the
2008 Nov 18
1
reshape question
Hi,
It's probably a simple issue but I'm struggling with that. I'll use the
example shown in the help page.
head(Indometh)
wide <- reshape(Indometh, v.names="conc", idvar="Subject",
timevar="time", direction="wide")
head(wide)
reshape(wide, idvar="Subject", varying=list(2:12),
v.names="conc",
2018 Jan 05
0
Calculating the correlations of nested random effects in lme4
I postulate the following model
AC <- glmer(Accuracy ~ RT*Group + (1+RT|Group:subject) +
(1+RT|Group:Trial), data = da, family = binomial, verbose = T)
Here I predict Accuracy from RT, Group (which has values 0 or 1) and the
interaction of Group and RT (those are the fixed effects). I also estimate
the random effects for both intercepts and slopes for subjects and
different trials.
2009 Nov 13
2
linear model and by()
Hello R list,
This is a question for anyone who has used the by() command. I would like to
perform a regression on a data frame by several factors. Using by() I think
that I have able to perform this using the following:
> lm.r <- by(master, list(Sectionf=Sectionf, startd=startd), function(x) lm
(tot.c ~ starttime, data = x))
So that is, I would like to perform separate regressions for
2008 Oct 28
1
How to export text into separate text files
Hello,
I'm producing text from my data.frame using cat function. I would like
to use for loop to export each column in my data.frame into separate
text files. Here is the example code
r <- t(Indometh)
for (i in 1:ncol(r)) {
cat("Some text,", "\n")
cat("\n")
cat("More text, More text, More text")
cat("\n")
2012 Dec 05
1
nlme starting values are not the correct length
Dear R community,
I am trying to fit an nlme model where I want to estimate the fixed effects of two treatments on the parameters on the following equation Photo~(a*(1-exp(-c*PARi/a)))-b
I was able to fit a simple model without covariates following the method described in Mixed-Effects Methods and Classes for S and S-PLUS, version 3.0, but when I add the covariates, I get the error "
2005 Feb 02
4
(no subject)
can you recommend a good manual for R that starts with a data set and gives
demonstrations on what can be done using R? I downloadedR Langauage
definition and An introduction to R but haven't found them overly useful.
I'd really like to be able to follow some tutorials using a dataset or many
datasets. The datasets I have available on R are
Data sets in package 'datasets':