Displaying 20 results from an estimated 200 matches similar to: "PCA with tow response variables"
2009 Dec 17
2
Exchange NAs for mean
Hi all,
I'm have a matrix (X) with observations as rows and parameters as columns. I'm trying to exchange all missing values in a column by the column mean using the code below, but so far, nothing happens with the NAs... Can anyone see where the problem is?
N<-nrow(X) # Calculate number of rows = 108
p<-ncol(X) # Calculate number of columns = 88
# Replace by columnwise
2009 Oct 27
1
Exclude rows in xyplot
Hi all,
I'm searching for a way to exclude outliers from my dataset while making xyplots. While plotting using pairs(), I exclude specific row in my data frame and save the settings as a variable which I later include as an argument:
# Discard outliers and save settings as idx
idx=with(fieldTrial0809, which(Pro>0 & Pro<0.95 & Fum>0 & Fum<0.4 & Mal>0.1 &
2009 Oct 14
1
Plot overview xy plots from data frame?
Hi,
I've got a data frame (556 rows and 36 columns) from which I need to create several xy plots and print to pdf, in order to detect outliers and trends in the data. 16 of the columns contains numerical values, and I would like to create graphs for all combinations. It can be done manually, but creating 256 plots by hand takes time... I guess I have to iterate through the data frame, but
2010 Jan 15
2
How to delete matrix rows based on NA frequency?
Hi all,
I would like to remove rows from a matrix, based on the frequency of missing values. If there are more than 10 % missing values, the row should be deleted.
I use the following to calculate the frequencies, thereby getting a new matrix with the frequencies:
freqNA=rowMeans(is.na(exprdata))
But is there a shorter way to remove the rows based on "(1-freqNA)>0.1"
2009 Nov 11
1
Loadings and scores from fastICA?
Hi all,
Does anyone know how to get the independent components and loadings from an Independent Component Analysis (ICA), as well as principal components and loadings from a Pricipal Component analysis (PCA) using the fastICA package? Or perhaps if there's another way to do ICAs in R?
Below is an example from the fastICA manual (http://cran.r-project.org/web/packages/fastICA/fastICA.pdf)
2010 Jan 28
2
NA Replacement by lowest value?
Hi all,
I need to replace missing values in a matrix by 10 % of the lowest available value in the matrix. I've got a function I've used earlier to replace negative values by the lowest value, in a data frame, but I'm not sure how to modify it...
nonNeg = as.data.frame(apply(orig.df, 2, function(col) # Change negative values to a small value, close to zero
{
min.val =
2009 Oct 16
2
Division of data frame and deletion of values from column
Hi all,
I guess this might be an easy question, but I've searched multiple help pages without finding any answear... so now I put my trust in you!
I have a data frame (36 variables and 556 observations). One column contains three factors, and I would like to divide the data frame into three new ones, based on the value of the factors, thereby having only one value for all elements of the
2009 Dec 07
1
Multiple regression script
Hi all,
I'm doing Multiple linear regression for a data set. However, it takes a lot of time, as I would like to check every possible combination of factors, evalute the results based for instance on their p values, and then choose the best regression model.
So, I wonder if anyone might have a script for that? Or if not, do you have some suggestions how to create such a script?
I've
2010 Jul 16
1
Creating symbolic expressions in R
Hello,
I'm trying to do some differential equation modeling in R using the
package 'deSolve.' Briefly, I'm trying to use the law of mass action
(the details of which aren't really important) to structure a vector
of rate equation which will be passed into an ODE function and solved
with associated functions from 'deSolve.' Roughly what this entails
is scanning
2010 Jul 21
0
Converting Between Character and Numeric Objects
Hello,
I'm trying to convert a vector of string objects to a numeric object by
initializing the variables with values. I use the function below to scan
through a matrix and create mass action flux relationships:
makeMassActionFluxes = function(sMatrix) {
#Allocate a matrix with identical dimensions as the inputted stoichiometric
matrix
temp = matrix(nrow = dim(sMatrix)[1], ncol =
2009 Nov 05
1
Set colors in a PCA plot based on a gradient vector
Hi all,
I'm making a PCA plot with eight variables (columns taken from a larger data frame "fieldTrial0809[idx,c(39:46)]"). I then want the symbols in the plot to be colored as a gradient from red to blue, depending on the value of another column in "fieldTrial0809[idx, c(48)]" containg temperatures from -12.1 to -5.4.
I don't want to use the heat.colors(n)
2000 Apr 28
1
Using 'by()' in a function
I have a list of dataframes, and want to apply a function to subsets of the rows
of each dataframe. It seemed natural to write a function that takes a dataframe
as an argument, and uses 'by() within it to apply the function to the dataframe
subsets. However, I cannot get it to work. The problem seems to be passing the
data argument of by() as a function argument. Is this bug, or am I
2011 Jul 07
2
kripp.alph error message
Hi! I fairly new to R, have only done pretty basic things so far, so this may
be a very basic question..... But I did search the forums and didn't see a
solution....
I'm trying to get going with kripp.alpha(). I'm loading data from a file,
like this:
> library(irr)
Loading required package: lpSolve
> x <- read.table("foo", comment.char="#", header=TRUE,
2006 Aug 10
1
How to fit bivaraite longitudinal mixed model ?
Hi
Is there any way to fit a bivaraite longitudinal mixed model using R. I have
a data set with col names
resp1 (Y_ij1), resp2 (Y_ij2), timepts (t_ij), unit(i)
j=1,2,..,m and i=1,2,..n.
I want to fit the following two models
Model 1
Y_ij1, Y_ij2 | U_i = u_i ~ N(alpha + u_i + beta1*t_ij, Sigma)
U_i ~ iid N(0, sigu^2)
Sigma = bivariate AR structure
alpha and beta are vectors of order 2.
2012 Nov 21
0
Two way manova
Hello everyone,
I would like to perform a 2-way manova test, but I'm having some issues.
I implemented like this
Y<-cbind(Resp1,Resp2,Resp3,....,Respn)
model<-manova(Y "tilda" FactorA*FactorB)
summary.aov(model)
1. I don't know at what level I have to do the Type I error correction. Is
it on p-values returned by "summary.aov(model)? Or is it when I compare each
2011 Feb 17
0
Multi-response MCMCglmm (gaussian and zapoisson)
Dear MCMCglmm users,
I am currently struggling with the specification of a proper prior and model formula for a multi-response MCMCglmm with two of the three response variables being Gaussian and the third being za-poisson. The model includes several fixed effects and three nested random effects.
In general, I would prefer to fit a model with a fixed effect of trait and suppressed intercept for
2008 Aug 07
2
colouring a tree
Hi all.
I would be very pleased if someone could help me, as I do not seem to get the different branches of my tree painted in different colours. The closest I get is colouring the names of my samples(=names of the branches). Here is the code.
data <- read.table(file = "S://SEDIM//TRFLP//B12.5_50-700bp.txt" , as.is = TRUE, header = TRUE, sep = "\t", row.names =
2004 Apr 28
1
simple repeated measures model: dumb user baffled!
I am in the process of transferring from an old version of S+ to using
R having used a variety of other packages in the past. I'm hugely
impressed with R but it has an excellent but depressing habit of exposing
that I'm not a professional statistician and has done so again.
Someone has run a nice little repeated measures design on my advice,
students randomised to four orders of a
2006 May 16
0
tow rails applications in a single virtual host in apache
I have apache as my seb server, and fastcgi.
I have two applications, a typo application (blog.iplan.com.ar) and a
demo application, and I have to merge these two applications so they can
all work in one single hosting.
In example, today, I have
blog.iplan.com.ar (typo)
and I need
<http://www.iplan.com.ar/> www.iplan.com.ar (typo)
blog.iplan.com.ar/demo (demo rails
2005 Jan 25
1
"spx_word16_t *" is incompatible with parameter of type "float *"
Hi,
I am bring SPEEX up on Analog Device's Blackfin (using Visual DSP++ tool set). The floating point was too slow on this fixed-point processor so I am going for the integer version.
The floating point library build was very clean, but when I build with FIXED_POINT defined, the compiler exits when it find this discrepancy in \libspeex\cb_search.c :
".\libspeex\cb_search.c",