Displaying 20 results from an estimated 9000 matches similar to: "editor: not possible to change the variable name"
2011 May 07
4
how to calculate the mean of a group in a table
Hi its me again
I don't mean to get on your nerves, but the use of R proofs to be a bit more
complicated than envisaged.
I would like to calculate the mean of a group of values, here
"wage_accepted". The group is determined by the stage and period, so in the
end there should be a column with the values of the wages in period 1
stage1, period 1 stage 2, period 2 stage1...
2011 Jun 21
5
omitting columns from a data frame
Dear R People:
I have a data frame, xm1, which has 12 rows and 4 columns.
If I put is xm1[,-4], I get all rows, and columns 1 - 3, which is as
it should be.
Now, is there a way to use the names of the columns to omit them, please?
Thanks so much in advance!
Sincerely,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be
different symbols and colors. It should represent what is in the legend.
I tried using the points command but this does not work. Is there
another command in R that would allow me to use different symbols and
colors for the points?
Thank you kindly.
data(mtcars)
plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",
2010 Oct 06
1
ANOVA subject-wise means
dear list,
is there any function in R with which i can compute subject-wise means for a
single factor level? for instance, i wanna have the mean for each subject
for the first level of factor A, how can i get that? is there a
straightforward way to solve this problem?
kind regards
jake
[[alternative HTML version deleted]]
2012 Jul 04
5
loop for regression
---------- Forwarded message ----------
From: Akhil dua <akhil.dua.12@gmail.com>
Date: Wed, Jul 4, 2012 at 10:33 AM
Subject:
To: r-help@r-project.org
Hi everyone I
have data on stock prices and market indices
and I need to run a seperate regression of every stock on market
so I want to write a "for loop" so that I wont have to write codes again
and again to run the
2011 Apr 07
3
Correlation Matrix
Listers,
I have a question regarding correlation matrices. It is fairly straight
forward to build a correlation matrix of an entire data frame. I simply use
the command cor(MyDataFrame). However, what I would like to do is construct
a smaller correlation matrix using just three of the variable out of my data
set.
When I run this:
cor(MyDataFrame$variable1,
2012 Jul 08
2
Notation for previous observation in a data frame
I've created a data frame in R, but in order to clean up some of the data,
I need to set certain variable observations equal to the value of their
previous observation (it would be conditional, but that part's less
important right now). In Stata, I would simply set var = var[_n-1] in those
cases. What is the R equivalent?
[[alternative HTML version deleted]]
2009 Dec 08
1
problem with split eating giga-bytes of memory
I'm having trouble using split on a very large data-set with ~1400 levels of
the factor to be split. Unfortunately, I can't reproduce it with the simple
self-contained example below. As you can see, splitting the artificial
dataframe of size ~13MB results in a split dataframe of ~ 144MB, with an
increase memory allocation of ~10 fold for the split object. If split scales
linearly, then my
2011 Apr 15
2
Extract information from the names of a list within lapply
Dear list,
I want to loop over a list through lapply and at the same time I want to
extract some information from the names of the list elements. lapply does
not seem to carry the names. Is there anyway to access the names of a list
within lapply? Thanks.
Jun
[[alternative HTML version deleted]]
2011 May 04
2
select value from a column depending on a value in another column
Hi everybody
I couldn't find the solution to what must be quite a simple problem. Maybe
you can help?
treatment session period stage wage_accepted market
1 1 1 1 1 25 public
2 1 1 1 1 19 privat
3 1 1 1 1 15 public
4 1
2007 Oct 24
3
Partial aggregate on sorted data
Hi All,
I'm looking for ways to compute aggregate statistics (with the aggregate
function) but with an option for sorting and selecting a subset of the data
frame. For example, I have would like to turn this :
aggregate(myDataframe$TargetValue,list(SomeFactor =
myDataframe$SomeFactor),mean)
into something like
aggregate(myDataframe$TargetValue,list(SomeFactor =
2010 Mar 11
2
Can't convert list to matrix properly
Hi guys, here is a list of names that I have:
MyList:
> myList<-list("A", "B","C","D")
> myList
[[1]]
[1] "A"
[[2]]
[1] "B"
[[3]]
[1] "C"
[[4]]
[1] "D"
I want to turn this list into a matrix of 1 row and 4 columns with those
four components (A, B, C, D) so here is what I do:
myDataFrame <-
2010 Apr 26
1
help with code
I am new to R and have tried for a good while to figure out how to code this
in R. The dataset below:
FTIStandKey
State
County
FTITract
CoverType
Ver_CT
V_Origin
V_SpGrp
NAH6005-001
Texas
Jasper
NAH6005
PPLB-2000-U
PPLB-2000-U
P
P
NAH6005-002
Texas
Jasper
NAH6005
NHHX-1950-O
NHHX-1950-I
N
H
NAH6253-001
Texas
Tyler
NAH6253
PPLB-2001-U
PPLB-2001-U
P
P
2011 Mar 03
2
PCA - scores
I am running a PCA, but would like to rotate my data and limit the
number of factors that are analyzed. I can do this using the
"principal" command from the psych package [principal(my.data,
nfactors=3,rotate="varimax")], but the issue is that this does not
report scores for the Principal Components the way "princomp" does.
My question is:
Can you get an
2011 May 21
1
How to intantiate a list of data.frames?
Hello,
I am newbie to R and I want to do this:
for(i in 1:6)
{
ds[i] <- list(df=data.frame(oilDF[,1],oilDF[,i+2]), df2=data.frame(oilDF2[,1],oilDF2[,i+2]))
}
#oilDF and oilDF2 are 2 data frames with several columns. They have different number of rows
#I want to have for example ds[1]$df, ds[1]$df2 with the respective data.frames.
#How can I instantiate a list of data.frames pairs
2012 Jul 19
2
problem with using apply for dataframe
Dear people,
I am including an example of a dataframe:
mydataframe<-data.frame(X=c(1:4),total_bill=c(16.99,10.34,21.01,23.68),tip=c(1.01,1.66,3.50,3.31),sex=c("Male","Male","Male","Female"))
When I use the sapply function getting the information about the factors
works:
sapply(mydataframe,function(x)is.factor(x))
X total_bill tip
2010 Apr 29
2
understanding behavior of "merge"
I'm trying to bootstrap resample from a repeated measures dataset. I sample
a vector of "ID"'s from my dataframe with replacement.
Then I merge this back with my dataframe.
I'm re-sampling subjects in the dataset rather than rows of the data.
I thought I could use the left/right join features of the merge to select
the records I want from the dataframe (mydataframe), like
2005 Apr 04
2
mysql retrive question
hello R-Users,
I have this simple but not for me question:
I do:
> res<-dbSendQuery(con, "SELECT * FROM tabellaProva")
> myDataFrame<-fetch(res)
> myDataMatrix<-as.matrix(myDataFrame[,-1])
> namerows(myDataMatrix)<-as.character(myDataFrame[,1])
and I have:
io tu
io "0" "1"
tu "1" "0"
my problem is that the
2012 Jul 04
2
Difference between two-way ANOVA and (two-way) ANCOVA
Hi!
as my subject says I am struggling with the different of a two-way ANOVA and
a (two-way) ANCOVA.
I found the following examples from this webpage:
http://www.statmethods.net/stats/anova.html
# One Way Anova (Completely Randomized Design)
fit <- aov(y ~ A, data=mydataframe)
# Randomized Block Design (B is the blocking factor)
fit <- aov(y ~ A + B, data=mydataframe)
# Two Way
2004 Nov 20
2
subset on data frame
I have a data frame. And I'd like to subset according to rownames.
subset(mydataframe, rownames(mydataframe) == myrow, select = mycols)
it turned out that "myrow" cannot be a vector. But I have multiple rows to
pick. Is there a way to get around this problem??
Thank you for your help!!
Lei Jiang
Department of Chemsitry
University of Washington
Box 351700
Seattle, WA 98195