Displaying 20 results from an estimated 10000 matches similar to: "Importing Data for a two sample t-test"
2012 Nov 19
6
How to subset my data and at the same time keep the balance?
Hi guys,
I have 1000 rows of a dataset. In my analysis, I need 70% of the data,
run my analysis and then use the remaining 30% to test my model.
Could anybody kindly help me on this?
Cheers
2012 Oct 12
3
Columns and rows
Hi,
Could you please advice some easy way to do the following for a dataframe
(header=F) having unequal column- & row- length.
1. Combine/stack/join contents from -
a) multiple rows into one column.
b) multiple columns into one row.
2. Stack contents from multiple columns (or, rows) into one column (or,
row).
Thank you.
Cheers,
Santana
[[alternative HTML
2012 Oct 28
6
Having some Trouble Data Structures
Hi All,
I'm trying to run a simulation of host-pathogen evolution based around individuals.
What I need to have is a dataframe or table of some description - describing all the individuals of a pathogen population (so far I've implemented this as a matrix):
ID No_of_Effectors Effectors (Sequences)
[1,] 0001 3 ## 3
2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all,
I have a .csv file like below.
Tool,Step_Number,Data1,Data2... etc up to 100 columns.
A,1,0,1
A,2,3,1
A,3,2,1
.
.
B,1,3,2
B,2,1,2
B,3,3,2
.
.
...... so on upto 50 rows
where the column "*Tool*" has distinct steps in second column
"*Step_Number*",but both have same entries in Step_Number column.
I want the output like below.
2012 Jul 04
2
Date
Hi
I have monthly data and the dates are in MM/YY Format
I need to convert them into DD/MM/YY format by pasting 01 in place of DD to
all the observations in my Year Column
ex:
Year Stock Prices
01/2000 1
02/2000 2
03/2000 3
I need to convert them to
Year Stock Prices
01/01/2000 1
01/02/2000 2
01/03/2000
2012 Dec 22
4
Does R have an equivalent for Matlab's cell array?
Hi
I have a time series of measurements: every 10 min. a value was logged.
The data look like:
20100914 08:01 3.74
20100914 08:11 3.74
20100914 08:21 3.71
20100914 08:31 4.39
20100914 08:41 3.74
This data spans several months.
I would like to group the data per day. In Matlab it is fairly easy to
obtain a cell array, of which the first column contains the date of each
2012 Sep 28
3
Better way of Grouping?
Hello R users,
This is more of a convenience question that I hope others might find useful
if there is a better answer. I work with large datasets that requires
multiple parsing stages for different analysis. For example, compare group
3 vs. group 4. A more complicated comparison would be time B in group 3 of
group L with B in group 4 of group L. I normally subset each group with
the
2012 Sep 24
3
List creation based on matrix
Hi guys,
It would be great if you could help me with this one...
I'm looking to create a script to convert a matrix of species abundance e.g:
<http://r.789695.n4.nabble.com/file/n4643978/species_matrix.jpg>
into two vectors e.g:
<http://r.789695.n4.nabble.com/file/n4643978/communitylist.jpg>
----------------
If you feel there is no easy answer to this and that it would be
2012 Aug 15
2
sample() from (un-)sorted vectors
Hello,
Vector y is an alphabetically sorted version of vector x. Will both
samples, X and Y, be "absolutely" random or will they have systematic
differences? And: Should I sort or shuffle a vector before sampling?
Thank you, *S*
x <- as.factor(LETTERS[sequence(10:1)])
y <- sort(x)
X <- sample(x, 5)
Y <- sample(y, 5)
--
Sascha Vieweg, saschaview at gmail.com
2012 Apr 23
2
.rda vs. .RData
Are they the same with .RData being the newer format?? Thanks,
...Tao
2013 Mar 01
7
Conditional Weighted Average (ddply or any other function)
Hello R community,
I am computing weighted average statistic by using ddply function:
My data set is:
N1 T1 S1 I1 C1 FY-4 ROE11 EPS11 MKT11
N1 T1 S1 I1 C1 FY-3 ROE12 EPS12 MKT12
N1 T1 S1 I1 C1 FY-2 ROE13 EPS13 MKT13
N1 T1 S1 I1 C1 FY-1 ROE14 EPS14 MKT14
N1 T1 S1 I1 C1 FY0 ROE15 EPS15 MKT15
N1 T1 S1 I1 C1 FY1 ROE16 EPS16 MKT16
N1 T1 S1 I1 C1 FY2 ROE17
2012 Jan 30
1
mgcv bam() with grouped binomial data
Hello,
I'm trying to use the bam() function in the R mgcv package for a large set of grouped binary data. However, I have found that this function does not take data in the format of cbind(numerator, denominator) on the left hand side of the formula. As an example, consider the following
dat1 <- data.frame(id=rep(1:6, each=3), num=rbinom(18, size=10, prob=0.8), den=rbinom(18, size=5,
2008 Mar 05
1
coxme - fitting random treatment effect nested within centre
Dear all,
I am using "coxme" function in Kinship library to fit random treatment effect nested within centre. I got 3 treatments (0,1,2) and 3 centres. I used following commands, but got an error.
> ugroup=paste(rep(1:3,each=3),rep(0:2,3),sep='/')
> mat1=bdsmatrix(rep(c(1,1,1,1,1,1,1,1,1),3),blocksize=rep(3,3),dimnames=list(ugroup,ugroup))
>
2016 Apr 14
3
Unequal column lengths
Hello,
I?ve tried several times to learn R, but have never gotten past a particular gate. My data are organized by column in Excel, with column headers in the first row. The columns are of unequal lengths. I export them as CSV, then import the CSV file into R. I wish to summarize the data by column. R inserts NA for missing values, then refuses to operate on columns with NA. R is importing
2012 Nov 29
2
Confidence intervals for estimates of all independent variables in WLS regression
I would like to obtain Confidence Intervals for the estimates
(unstandardized beta weights) of each predictor in a WLS regression:
m1 = lm(x~ x1+x2+x3, weights=W, data=D)
SPSS offers that output by default, and I am not able to find a way to do
this in R. I read through predict.lm, but I do not find a way to get the
CIs for multiple independent variables.
Thank you
Torvon
[[alternative HTML
2010 Aug 04
1
Carriage return character issue
Hi all,
I imported a file (in CSV format) into R for processing, then imported the
result into MySQL. However, there are *carriage return* characters
(hexadecimal: *0D*) that are appended to the characters in the last field of
the table.
i.e *\r* appended to the character values (as shown below)
Before importing into MySQL: asdf
After importing into MySQL: asdf*\r*
**
**
Are there any options
2012 Mar 15
2
summing "transfers"
I have a dataframe from an On-Board Survey with weights ("expwgt") and variables for up to 8 used lines: VEH1 through VEH8. The lines are labeled "MT-..1" through "MT-902". I want to know how many transfers there are between MT-802 and MT-901. That is, when one of them is VEHx and the other is VEHx+1 or VEHx-1
E.g. {VEH1 = MT-802 AND VEH2 = MT-901 } plus {VEH2 =
2013 Apr 30
1
Error message
Hi there
I am a Masters student at the University of Stellenbosch. I have been using R to analyze the data, using the GLS model, of one of my experiments.
The problem that I am having is that whenever I run my model using:
fit.glsmodel1<-gls(Number~as.factor(Season)+as.factor(Depth)+as.factor(Orientation), data=Number, weights=varPower(), method="ML")
I get the error:
Error in
2011 Jul 16
1
MatchIt Package
Hi there dear R users!
Anyone knows why does matchit function returns error whenever the "hull" option is used (either "hull.both", "hull.control" or "hull.treat"). Things work well with all the rest of discard options.
This is the error msg.
>m.out.base <- matchit(formula=f, data=d, method=m, discard="hull.control")
[1]
2012 Sep 19
2
Warning Message: In if (deparse(params[[nm]][[3]]) != "1")
I am using the gnls procedure in nlme package to fit a nonlinear model as:
nl.fit<-gnls(Y ~ b0*exp(b1/X),
data = data1,
params=list(
b0~p1+I(p1^2)+p2+I(p2^2)+p3+I(p3^2)+p5+p6
b1~p8+p2+I(p2^2)+p3+p9+p10+p11),
start = c(25,0,0,0,0,0,0,0,0,-8.6,0,0,0,0,0,0,0),
weights=varPower(form =~ X)