similar to: extracting data from a dataframe

Displaying 20 results from an estimated 10000 matches similar to: "extracting data from a dataframe"

2002 Jun 30
4
modifying a vector
Hello everyone, Thanks to all who offered suggestions after my initial query to the list. I've been busy trying to absorb the docs as fast as possible, but this little thing has me stumped for the moment. I'm creating a random sample of 100 item and saving it to a vector named 'iq'. I'd like to create a second vector (iq_prime, say) by adding 20 to each element of the
2002 Jun 30
4
modifying a vector
Hello everyone, Thanks to all who offered suggestions after my initial query to the list. I've been busy trying to absorb the docs as fast as possible, but this little thing has me stumped for the moment. I'm creating a random sample of 100 item and saving it to a vector named 'iq'. I'd like to create a second vector (iq_prime, say) by adding 20 to each element of the
2002 Jul 03
2
operating on a subset of a dataframe
Hi everyone, I've got a dataframe with columns of different types. A certain number of columns in the dataframe hold the results of a series of Likert-type items. I've got a function that will print a simple table of frequencies and I want to apply that function to those columns of the dataframe only. What's the best approach? -Tim -- Tim Wilson | Visit Sibley online: |
2002 Jul 26
3
Fisher r-to-z transformation
Hi everyone, I want to use the Fisher r-to-z transformation as part of a hypothesis test of r. I can't find an R function that can do that. Am I missing it? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.org | http://www.zope.com W. St. Paul, MN | | http://slashdot.org wilson at visi.com | <dtml-var
2002 Aug 20
2
weighting means
Hi everyone, I've got a dataframe called 'faculty'. I want to do a weighted mean on the column called 'Q8' weighted by the contents of column 'CETP'. In addition, I need to operate on the result of splitting 'faculty' according to the contents of a column 'FACULTY'. For example > lapply(split(faculty$Q8, faculty$FACULTY), mean) $"1" [1]
2002 Aug 22
1
combining output from several operations
Hi everyone, I wonder if there's a patient soul out there who has a minute to look at the following. I've got a set of summary statistics I need to perform many times. Naturally, I've looked at writing a function to automate the process as much as possible. (These are the data I mentioned recently in my question about weighted means.) I'm having trouble figuring out the proper
2002 Aug 07
3
Forcing integers to be nominal
Hi everyone, I've got a problem with an analysis of variance where it appears that my independent variable is being treated as an integer when it should be nominal. The data are being loaded from an SPSS file and the independent variable 'YearColl' corresponds (surprisingly enough) to a student's year in college. :-) The integers 1-4 are used in the dataset for this purpose. My
2002 Jul 12
1
lmtest build fails, readline problem
Hi everyone, I've downloaded the lmtest package, but I'm having trouble building it. Here's the output: copland:/home/wilson/tmp# R CMD INSTALL -l /usr/lib/R/library lmtest_0.9-0.tar.gz * Installing *source* package 'lmtest' ... ** libs g77 -fPIC -g -O2 -c pan.f -o pan.o gcc -shared -o lmtest.so pan.o -L/usr/lib/gcc-lib/i386-linux/2.95.4 -lreadline -ldl -lncurses
2002 Aug 15
2
complex splits
Hi everyone, I'm having trouble figuring out how to split a dataframe more than once. Let's say I have a dataframe d with a certain column called splitcol composed of four possible ordinal values. The same dataframe has two other columns, col1 and col2, that have one of two possible values each. I'd like to split d$splitcol based on col1 and col2 so I can report frequencies of the
2011 Jan 23
2
Creating subsets of a matrix
Hello, Say I have 2 columns, bmi and gender, the first being all the values and the second being male or female. How would I subset this into males only and females only? I have searched these fora and read endlessly about select[] and split() functions but to no avail. Also the table is not ordered. bmi gender -> bmi gender + bmi gender 1 24.78 male
2006 Jul 18
1
Classification error rate increased by bagging - any ideas?
Hi, I'm analysing some anthropometric data on fifty odd skull bases. We know the gender of each skull, and we are trying to develop a predictor to identify the sex of unknown skulls. Rpart with cross-validation produces two models - one of which predicts gender for Males well, and Females poorly, and the other does the opposite (Females well, and Males poorly). In both cases the error
2008 May 02
1
Cant resolve Error Message
Hi, Im having trouble creating the following graph. Here is my code: library(plotrix) library(prettyR) female_improvement <-read.table("C://project/graphs/gender/breakdown/gender-improvement/female-improvement.csv", sep=",", header=TRUE) barp(rbind(rep(length(female_improvement$gender),2),freq(female_improvement$reason)[[1]]), ylab="22 Males participated in the
2010 Jan 21
1
Simple effects with Design / rms ols() function
Hi everyone, I'm having some difficulty getting "simple effects" for the ols() function in the rms package. The example below illustrates my difficulty -- I'll be grateful for any help. #make up some data exD <- structure(list(Gender = structure(c(1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L), .Label = c("F", "M"), class = "factor"),
2002 Jul 06
1
R: one-sample binomial test
try ?power.prop.test > -----Messaggio originale----- > Da: Tim Wilson [mailto:wilson at visi.com] > Inviato: sabato 6 luglio 2002 6.05 > A: R-help > Oggetto: [R] one-sample binomial test > > > Hi everyone, > > Here's how I solved a problem for my stats class. I'm pretty sure I > understand what's going on, but I wonder if there's a more >
2004 May 16
1
Newbie Poisson regression question
Greetings. I'm getting started learning R, and I'm trying to reproduce some models I've done previously in SAS. I'm trying to fit simple Poisson regressions, and I keep getting impossible results: the models predict negative numbers of cases for many observations. The code for the models are: Female.model <- glm(Observed ~ Black + Other, family = poisson(link=log),
2006 Nov 25
3
Multiple Conditional Tranformations
Greetings, I'm learning R and I'm stuck on a basic concept: how to specify a logical condition once and then perform multiple transformations under that condition. The program below is simplified to demonstrate the goal. Its results are exactly what I want, but I would like to check the logical state of gender only once and create both (or any number of) scores at once.
2012 Dec 30
3
Odds Ratio and Logistic Regression
Dear All, I am learning the ropes about logistic regression in R. I found some interesting examples http://bit.ly/Vq4GgX http://bit.ly/W9fUTg http://bit.ly/UfK73e but I am a bit lost. I have several questions. 1) For instance, what is the difference between glm.out = glm(response ~ poverty + gender, family=binomial(logit), data=mydata) and glm.out = glm(response ~ poverty * gender,
2003 Aug 29
3
Creating a new table from a set of constraints
Hi Everyone, Here's a silly newbie question. How do I remove unwanted rows from an R table? Say that I read my data as: X <- read.table("mydata.txt") and say that there are columns for age and gender. Call these X[5] and X[10], respectively. Here, X[5] is a column of positive integers and X[10] is binary valued i.e., zero (for male) and one (for female) Now, say that I
2013 Nov 20
4
How to stop Kaplan-Meier curve at a time point
Hello R users I have a question with Kaplan-Meier Curve with respect to my research. We have done a retrospective study on fillings in the tooth and their survival in relation to the many influencing factors. We had a long follow-up time (upto 8yrs for some variables). However, we decided to stop the analysis at the 6year follow up time, so that we can have uniform follow-up time for all the
2002 Jun 28
4
R for simple stats
Hi everyone, I'm taking a course in statistics as part of my doctoral program in education at the U. of Minnesota, USA. I found R via Rpy, a python module that makes it possible to use R from python scripts. The instructor refers to SPSS a lot and that seems to be the standard stats tool around here. But being more of a Unix guy and not intimidated by programming, I'd like to see if I