similar to: performing functions on variables of different length

Displaying 20 results from an estimated 9000 matches similar to: "performing functions on variables of different length"

2006 Jun 18
1
how to successfully remove missing values for a repeated measures analysis
Hello , I am hoping for some advice. I want to run a repeated measures ANOVA. The primary problem is that my attempt to remove missing values created a dataset of missing values. The data set consists of 92 rows (1 row per participant) x 186 variables. The steps of the analysis undertaken are outlined below (#). Any assistance is appreciated in relation to how to remove the missing values so
2006 May 02
0
Enquiry regarding Apply
I want to compute a new variable (newvar) based on the values of two other variables (t1freq, t2freq).The two variables (t1freq,t2freq) are contained in a dataframe - study1dat <- read.csv("c:\\study1rb.csv",header=T) . I gather this computation can be done using Apply and I have run the following example from the help menu ## Compute row and column sums for a matrix: x
2006 Apr 22
1
Missing values detected when there are no missing values
I am hoping for some advice on the following matters. I have a csv data file with 153 variables x 92 rows. To determine what the variables looked like I ran the summary command. One variable had a large number of missing values 54/92. For some reason, all subsequent 74 variables are reported as having 92 NA values, irrespective of whether the original csv variable was complete or not.
2006 Mar 17
3
Binning question (binning rows of a data.frame according to a variable)
Hi, I have tuples of data in rows of a data.frame, each column is a variable for the 'items' (one per row). One of the variables is the 'size' of the item (row). I would like to cut my data.frame into groups such that each group has the same *total size*. So, assuming that we order by size, some groups should have several small items while other groups have a few large
2005 Jun 26
4
Mixed model
Hi All, I am currently conducting a mixed model. I have 7 repeated measures on a simulated clinical trial. If I understand the model correctly, the outcome is the measure (as a factor) the predictors are clinical group and trial (1-7). The fixed factors are the measure and group. The random factors are the intercept and id and group. I tried using 2 functions to calculate mixed effects.
2007 Jan 19
1
Suggestion on how to improve efficiency when using MASS:::hubers on high-dimensional arrays
Hi Everyone, Given the scenario I have, I was wondering if anyone would be able to give me a hind on how to get the results from hubers() in a more efficient way. I have an outcome on an array [N x S x D]. I also have a factor (levels 1,2,3) stored on a matrix N x S. My objective is to get "mu" and "sigma" for each of the N rows (outcome) stratified by the factor
2006 Jan 04
5
multiple lowess line in one plot
I'm using this code to plot a smoothed line. These two columns of data really represent 4 groups and I'd like to plot a separate line for each group but have them all in the same plot. The R-Docs for lowess do not seem to indicate some type of "GROUPS=var_name" option. What would be the syntax for this? plot(AWGT ~ lipid ) lines(lowess(lipid , AWGT, f=.8)) -- Dean
2010 Sep 03
6
how can I plot bar plots with all the bars (negative and positive) in the same direction????
Dear r-help mailing list, this seems stupid, but I actually don't find the solution: if I have a vector of numbers x of length n, ranging, say, from -3 to 4, if I do barplot (x) all the values below 0 go downwards, and all the positive values go upward. How can I make them all begin from the minimum pointing upwards? Thanks! Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical
2013 Nov 06
1
R help-classification accuracy of DFA and RF using caret
Hi, I am a graduate student applying published R scripts to compare the classification accuracy of 2 predictive models, one built using discriminant function analysis and one using random forests (webpage link for these scripts is provided below). The purpose of these models is to predict the biotic integrity of streams. Specifically, I am trying to compare the classification accuracy (i.e.,
2009 Jan 20
5
Problem with subset() function?
Hi all, Can anyone explain why the following use of the subset() function produces a different outcome than the use of the "[" extractor? The subset() function as used in density(subset(mydf, ht >= 150.0 & wt <= 150.0, select = c(age))) appears to me from documentation to be equivalent to density(mydf[mydf$ht >= 150.0 & mydf$wt <= 150.0, "age"])
2006 Jul 17
1
sem: negative parameter variances
Dear Spencer and Prof. Fox, Thank you for your replies. I'll very appreciate, if you have any ideas concerning the problem described below. First, I'd like to describe the model in brief. In general I consider a model with three equations. First one is for annual GRP growth - in general it looks like: 1) GRP growth per capita = G(investment, migration, initial GRP per
2009 Jun 17
2
Re gression by groups questions
I have a large dataset grouped by a factor and I want to perform a regression on each data subset based on this factor. There are many ways to do this, posted here and elsewhere. I have tried several. However I found one method posted on the R wiki which works exactly as I want, and I like the elegance and simplicity of the solution, but I don't understand how it works. Its all in the formula
2009 Jun 23
1
How to exclude insignificant intercepts using "step" function
I posted this question way down at teh end of another thread realted to an error in step, but that was stupid since it really is another matter altogether. I should have posted it separately, as I have now done. The code below creates a data.frame comprising three marginally noisy surfaces. The code below (including a fix courtesy of David Winsemius that avoids a step function error through use
2007 Dec 30
2
auth-master permission error
On F7, I get to where I have Postfix and Dovecot installed and configured, postfix check runs fine, but when I try to start Dovecot I'm getting a permission error. Here is the log entry: Dec 29 21:54:06 grp-01-50-90 dovecot: Dovecot v1.0.7 starting up Dec 29 21:54:06 grp-01-50-90 dovecot: Generating Diffie-Hellman parameters for the first time. This may take a while.. Dec 29 21:54:06
2003 May 19
1
plotting a simple graph
I am having great difficulty plotting what should be a simple graph. I have measured 1 'y' and 5 'x' variables in each of two groups. Linear regression shows significant differences in the slopes of the regression for each 'x' variable between the two groups. All that I want to do is to plot one graph that shows the scatterplot for the three groups (each group represented
2009 May 08
1
glm fit
Hi, I try to ask here, because I hope someone will help me understand this problem- I have fittet a glm in R with the results > glm1 <- > glm(log(claims)~log(sum)*as.factor(grp),family=gaussian(link="identity")) > summary(glm1) Call: glm(formula = log(claims) ~ log(sum) * as.factor(grp), family = gaussian(link = "identity")) Deviance Residuals: Min 1Q
2010 Dec 06
3
[plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function
Dear R-Helpers: I am using trying to use *ddply* to extract min and max of a particular column in a data.frame. I am using two different forms of the function: ## var_name_to_split is a string -- something like "var1" which is the name of a column in data.frame ddply( df, .(as.name(var_name_to_split)), function(x) c(min(x[ , 3] , max(x[ , 3]))) ## fails with an error - case 1 ddply(
2010 Oct 19
2
superpose.polygon, panel.polygon and their colors
Dear R-helpers, the problem I'm facing today is to convince lattice to paint some areas in gray. The areas I would like to have in gray, are confidence bands I've googled around in the mailing list archives and eventually find some clues. This link is my starting point http://tolstoy.newcastle.edu.au/R/e2/help/07/04/15595.html I'm reproducing here the code for your convenience est
2009 Jul 03
3
Variable names in lattice XY-plot
Hi, how can I get a more descriptive text instead of the variable names in my XY-lattice plot, according to the table below? Variable text acet = "Acetylaspartate Thalamus" chol = "Choline Thalamus" acetp = "Acetylaspartate parieoc" ino = "Inositole Thalamus" I could not find a solution. Please have a look at my syntax. Thanks a lot,
2018 Mar 06
0
Capturing warning within user-defined function
1. I did not attempt to sort through your voluminous code. But I suspect you are trying to reinvent wheels. 2. I don't understand this: "I've failed to find a solution after much searching of various R related forums." A web search on "error handling in R" **immediately** brought up ?tryCatch, which I think is what you want. If not, you should probably explain why it