Displaying 20 results from an estimated 28 matches for "mydata1".
Did you mean:
mydata
2009 Jan 06
5
Using apply for two datasets
I can run one-sample t-test on an array, for example a matrix myData1,
with the following
apply(myData1, 2, t.test)
Is there a similar fashion using apply() or something else to run
2-sample t-test with datasets from two groups, myData1 and myData2,
without looping?
TIA,
Gang
2006 Feb 20
3
Boxplot Help for Neophyte
R helpers
I am getting to grips with R but came across a small problem today that I
could not fix by myself.
I have 3 text files, each with a single column of data. I read them in
using:
myData1<-scan("C:/Program Files/R/myData1.txt")
myData2<-scan("C:/Program Files/R/myData2.txt")
myData3<-scan("C:/Program Files/R/myData3.txt")
I wanted to produce a chart with 3 boxplots of the data and used:
boxplot(myData1, myData2, myData3)
This worked fine so...
2011 Feb 25
1
speed up process
...n't matter here
mypos <- c("topleft", "topright","bottomleft")
#run the function for columns 3&4 as y (seq.yvar) with column 2 as x
(ind.xvar) for all 3 datasets (mydata_list)
par(mfrow=c(2,1))
for (i in seq_along(seq.yvar)){
k <- seq.yvar[i]
plot(mydata1[[k]]~mydata1[[ind.xvar]], type="p",
xlab=names(mydata1)[ind.xvar], ylab=names(mydata1)[k])
for (j in seq_along(mydata_list)){
foo_reg(dat=mydata_list[[j]], xvar=ind.xvar, yvar=k, mycol=j,
pos=mypos[j], name.dat=names(mydata_list)[j])
}
}
I tried with lapply() or mapply() but...
2012 May 15
4
reading data into R
Hi I am really new using R, so this is really a beginner stuff! I
created a very small data set on excel and then converted it to .csv
file. I am able to open the data on R using the command "read.table
("mydata1.csv", sep=",", header=T)" and it just works fine. But when I
want to work on the data (e.g. calculate the mean of variable "X") R
says "object not found". I tried the "attach" command or "mean
("mydata1.csv"&X)" but still...
2011 Feb 28
0
Fwd: Re: speed up process
Dear Jim,
Here is again exactly what I did and with the output of Rprof (with this
reduced dataset and with a simpler function, it is here much faster than
in real life).
Thanks you again for your help!
## CODE ##
mydata1<- structure(list(species = structure(1:8, .Label =
c("alsen","gogor", "loalb", "mafas", "pacyn", "patro", "poabe",
"thgel"), class = "factor"), fruit = c(0.52, 0.45, 0.43, 0.82, 0.35,
0.9, 0.68, 0), Asfc...
2012 Jul 03
1
insert missing dates
Hello
I have dataframes.
mydata1 <-data.frame(value=c(15,20,25,30,45,50),dates=c("2005-05-25 07:00:00
","2005-05-25 19:00:00","2005-06-25 07:00:00","2005-06-25 19:00:00
","2005-07-25 07:00:00","2005-8-25 19:00:00"))
or
mydata2 <-data.frame(value=c(15,20,25,30,45,50)...
2011 Sep 07
1
randomForest memory footprint
...lumns with lots of
NA's and I used knn imputation to fill in other gaps.
When I load in my dataset, R uses no more than 100 megs of RAM. I'm
running a 64-bit R with ~4 gigs of RAM available. When I execute the
randomForest() function, however I get memory complaints. Example:
> summary(mydata1.clean[,3:10])
cmp_fname_c1 cmp_lname_c1 cmp_sex cmp_bd
cmp_bm cmp_by cmp_plz is_match
Min. :0.0000 Min. :0.0000 Min. :0.0000 Min. :0.0000
Min. :0.0000 Min. :0.0000 Min. :0.00000 FALSE:572820
1st Qu.:0.2857 1st Qu.:0.10...
2013 May 02
0
Data in packages: save or write.table?
Hi all,
I am trying to understand Writing R Extension...
Section 1.1.5, data: I include two datasets in a package, one using 'save',
the other using 'write.table':
--- 8< ----
myData1 <- data.frame(x=1:10)
write.table(myData1,file="myData1.txt")
myData2 <- data.frame(x=2:10)
save(myData2,file="myData2.Rdata")
--- 8< ----
Then R CMD check aks me to document myData1, but does not ask me to document
myData2.
In the R session, after 'library(myPack)...
2011 Jul 11
1
GLS - Plotting Graphs with 95% conf interval
...f1<-formula(MaxNASC40_50~hu3+flcmax+TidalFlag)
vf1Exp<-varExp(form=~hu3)
B1D<-gls(f1,correlation=corGaus(form=Lat~Lon, nugget=TRUE),weights=vf1Exp ,
data=ocean)
ochu3<-seq(from=2.9,to=4,length=120)
ocflc<-seq(from=0,to=0.8,length=120)
tidal1<-rep(c("1"),length=120)
mydata1<-data.frame(TidalFlag=factor(tidal1),hu3=ochu3,flcmax=ocflc)
lineNASC1<-predict(B1D,newdata=mydata1,type="response")
lineNASC1<-as.data.frame(lineNASC1)
plot(ocean$MaxNASC40_50[ocean$TidalFlag==1]~ocean$flcmax[ocean$TidalFlag==1)
lines(lineNASC1$lineNASC1~mydata1$flcmax)
Tidal...
2012 Jun 06
3
problem about set operation and computation after split
...;s correct too, but stll too complex, so my question is:
Can I do the same thing just use another similar intersect function
(without for/repeat/while).
What's this simple function's name ?
2.how to do a relative computation after split (notice: not befor split)?
create data:
myData1 <- data.frame(product = c(1,2,3,1,2,3),
year=c(2009,2009,2009,2010,2010,2010),value=c(1104,608,606,1504,508,1312),relative=0)
mySplit1<- split(myData1,myData1$year)
mySplit1
$`2009`
product year value relative
1 1 2009 1104 0
2 2 2009 608 0
3 3 200...
2008 Apr 15
2
How can I import user-defined missings from Spss?
...est.sav".
*-----------------------------------------------------------------------------------------.
2) Import the Spss Data in R. Via Hmisc or foreign - both work fine.
#import Spssdata in R
spssfile <- "C:/tmp/test.sav"
#via Hmisc
library(Hmisc)
Signs <- c("_")
mydata1 <- spss.get(spssfile,lowernames=TRUE, allow=Signs)
#via foreign
library(foreign)
mydata2 <- read.spss(spssfile,use.value.labels=TRUE, max.value.labels=Inf, to.data.frame=TRUE)
#freq in r
describe(mydata1)
describe(mydata2)
*-----------------------------------------------------------------...
2010 Jan 22
1
confidence intervals for mean (GLM)
Dear useRs,
How could I obtain the confidence intervals for the means of my treatments, when my data was fitted to a GLM?
I need the CI's for the Poisson and Negative Binomial distributions.
Here's what I have:
mydata1 <- data.frame('treatments'=gl(4,20), 'value'=rpois(80, 1))
model1 <- glm(value ~ treatments, data=mydata1, family=poisson)
means1 <- with(mydata1, tapply(value, treatments, mean))
now I need the confidence intervals for the means
And then again for a negative binomial GLM...
2013 Jan 10
1
Semi Parametric Bootstrap
...R code#######
fit1s <-glm(mydata$vzv~mydata$age.c+mydata$age2+mydata$sex1,
family=Gamma(link=log))
x.betahat1<-fit1s$fitted.values
res1<-fit1s$residuals
b<-1000
for (i in 1:b){
b.i <- sample(index, size=n, replace=T)
res.star1=res1[b.i]
bst1=x.betahat1+res.star1
mydata1 <-data.frame(age,age2,sex,bst1)
########Modeling ################
fit11 <-glm(bst1~age+age2+sex, family=Gamma(link=log),data=mydata1)
}
Can someone help me correct this code? Kindly advice on Binomial data
as well
Happy New year2013!
-- _______________________________
Paul...
2018 Mar 15
3
stats 'dist' euclidean distance calculation
...col(Mydata))]
locus
# Locus1 Locus2 Locus3
# Samp1 GG <NA> GG
# Samp2 AG CA GA
# Samp3 AG CA GG
# converts geno matrix to genind object (adegenet)
Mydata1 <- df2genind(locus, ploidy = 2, ind.names = ind[1:SAMPS], pop = population[1:SAMPS], sep="")
Mydata1$tab # get stats on newly created genind object
# Locus1.G Locus1.A Locus2.C Locus2.A Locus3.G Locus3.A
# Samp1 2 0...
2011 Feb 13
2
creating NAs for some values only
Hello,
I have some data file, say, mydata
1,2,3,4,5,6,7
3,3,4,4,w,w,1
w,3,6,5,7,8,9
4,4,w,5,3,3,0
i want to replace some percentages of "mydata" file in to NAs for those values
that are NOT w's. I know how to apply the percentage thing here but don't know
how to select those values that are not "w"s. So far, i was able to do it but
the result replaces the w's
2008 Jun 24
1
Error Handling
...atically if specified condition met. This can solve my problem that I need to set the NA values manually and reset j in for-loop every time error returned. Doing this manually would be very tedious.
m1<-matrix(ncol=3,nrow=0)
for (j in 1:1000){
fit<-lme(Expression~1,random=~1|MonkeyID, data=mydata1,subset=Probes==as.character(Probes_Blood_sub[j,"probe"]))
ci<-intervals(fit)$reStruct$MonkeyID^2
m1<-rbind(m1,ci)}
Thanks,Sityee
_________________________________________________________________
The i’m Talkathon starts 6/24/08. For now, give amongst yourselves.
[[alternative...
2012 Apr 05
0
Multi part problem...array manipulation and sampling
...an array with dim (22,161,56), which is populated by either a
number (NTOTAL), or an NA.
I then converted the NAs to zeroes;
mydata[is.na(mydata)] <- 0
To get the total number of records per sitesurvey i used;
array.dat1<-array(0,dim=c(22,1,56))
for (i in 1:56){
array.dat1[,,i]<-rowSums(mydata1[,,i],1)
}
array.dat1[which(array.dat1==0)] = NA
SO when array.dat1=0, that represents that there was no survey.
To combine this information with the original matrix i used
new.mydata<-array(0,dim=c(22,162,56))
new.mydata[1:22,1:161,1:56]<-mydata
new.mydata[1:22,162,1:56]<-array.dat1
wh...
2010 Nov 11
2
Kolmogorov Smirnov Test
I'm using ks.test (mydata, dnorm) on my data. I know some of my
different variable samples (mydata1, mydata2, etc) must be normally
distributed but the p value is always < 2.0^-16 (the 2.0 can change
but not the exponent).
I want to test mydata against a normal distribution. What could I be
doing wrong?
I tried instead using rnorm to create a normal distribution: y = rnorm
(68,mean=mydata, s...
2006 Nov 30
0
problem with chiMerge
Hi, I am trying to discretize a numeric attribute of a data.frame using
chiMerge
mydata2<-chiMerge(mydata1, c(7), alpha = 0.05)
but this command never returns, and I have to forcefully STOP the
operation. Is this a bug or am I missing somthing?
Can anybody help me. please?
Thanks in advance.
2011 May 11
0
Init nnetTs (or nnet?) with a former Neural Net
...a new net
for the old ponts plus the next 1000 points (81000 datapoints total) what
would again
cost much calculation time.
So I want to pre-init the new net with the former wonnen net to reduce the
necessary
iteration numbers.
Is thee a possibility to do that and how?
i.e.:
x=ts(scan("C:/mydata1.csv"))
mod.nnet<-nnetTs(x,m=2,size=8)
x=ts(scan("C:/mydata2.csv"))
mod.nnetnew<-nnetTs(x,m=2,size=8,control=list(init=mod.nnet)) ???
Thanks for any help !!
--
View this message in context: http://r.789695.n4.nabble.com/Init-nnetTs-or-nnet-with-a-former-Neural-Net-tp3514825p3...