similar to: read.spss: variable.labels

Displaying 20 results from an estimated 4000 matches similar to: "read.spss: variable.labels"

2008 Aug 25
4
R for Windows GUI closes when I try to read.spss
** High Priority ** I have been trying to read an SPSS file into R using read.spss ("C:/Documents and Settings/Roderick Harrison/My Documents/RWORK/ihisdat.sav", use.value.labels = TRUE, to.data.frame = FALSE, max.value.labels = 500, trim.factor.names = FALSE, trim_values = TRUE, reencode = NA, use.missings = to.data.frame) Each time (at least 5 or 6 by now) I get the following
2012 Jun 25
1
read.spss function
Hi dear all, I am trying to import a dataset from SPSS into R (R x64 2.15.0). I used both   read.spss("D:/Untitled2.sav", use.value.labels = TRUE, to.data.frame = TRUE, max.value.labels = Inf, trim.factor.names = FALSE,trim_values = TRUE, reencode = NA, use.missings = to.data.frame) & read.spss("D:\\Untitled2.sav", to.data.frame = TRUE, stringsAsFactors = FALSE)   but the
2008 Oct 09
2
Plot grouped histograms
r11 -- r16 are variables showing a reason for usage of a product in 6 different situations. Each variable is a factor with 4 levels imported from a SPSS sav file with labels ranging from "not important" to "very important", and NA's for a sample of N = 276. (1) I need a chi square test of independence showing that the reason does not differ depending on the
2008 Dec 14
1
re ad.spss (foreign) conflict with SPSS 17 files.
SPSS seems to have changed its default datafile format, resulting in issues for read.spss(). In Windows this results in a warning, in Debian the import completely fails: Debian (R version 2.8.0 (2008-10-20) i486-pc-linux-gnu, foreign_0.8-29) > read.spss("/home/jeroen/samples/Tomato.sav") Error in iconv(names(rval), cp, "") : unsupported conversion from 'CP65001'
2009 Nov 22
3
Define return values of a function
I have created a function to do something: i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1))) k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob=c(12, 7, 9, 1))) mytable <- function(x){ xtb <- x btx <- x # do more with x, not relevant here cat("The table has been created,
2011 Oct 11
4
need help on read.spss
Hi, I have one doubt about one of the parameter of 'read.spss()' from 'foreign' package. Here is the syntax :- read.spss ( file, use.value.labels = TRUE, to.data.frame = FALSE, max.value.labels = Inf, trim.factor.names = FALSE, trim_values = TRUE, reencode = NA, use.missings = to.data.frame ) In above syntax when I pass *'to.data.frame=
2009 Mar 06
4
Summary grouped by factor
### example:start v <- sample(rnorm(200), 100, replace=T) k <- rep.int(c("locA", "locB", "locC", "locD"), 25) tapply(v, k, summary) ### example:end ... (hopefully) produces 4 summaries of v according to k group membership. How can I transform the output into a nice table with the croups as columns and the interesting statistics as lines? Thx,
2009 Mar 11
3
chisq.test: decreasing p-value
A Likert scale may have produced counts of answers per category. According to theory I may expect equality over the categories. A statistical test shall reveal the actual equality in my sample. When applying a chi square test with increasing number of repetitions (simulate.p.value) over a fixed sample, the p-value decreases dramatically (looks as if converge to zero). (1) Why? (2) (If
2009 Apr 08
1
read.spss, locale and encodings
I must be missing something obvious here: According to the help page for read.spss, the reencode option is only active when R is run under a UTF-8 locale. read.spss can only import the SPSS file when run under a iso88591(5) locale, under a UTF-8 locale I get: Error in read.spss("wo.sav") : error reading system-file header In addition: Warning message: In read.spss("wo.sav")
2009 Jan 07
1
Importing data from SPSS with Arabic encoding
Dear R-users, I'm facing a problem with the import of data in R. I have a sav file that, I presume, uses some Arabic encoding (but I don't know which one) and I would like to read it with R. When I use the function read.spss (I also tried spss.get(Hmisc)), I get the following message: > read.spss("Hhld.sav") Erreur dans read.spss("Hhld.sav") : erreur ? la lecture
2009 Feb 17
2
spss-file problem with foreign 0.8-32
Hi, after updating to foreign version 0.8-32, I experienced the following error when I tried to load a SPSS file: Fehler in inherits(x, "factor") : objekt "cp" nicht gefunden Zus?tzlich: Warning message: In read.spss("***l.sav", use.value.labels = TRUE, to.data.frame = TRUE) : ***.sav: File-indicated character representation code (1252) looks like a Windows
2008 Oct 21
1
SPSS to R conversion "error in iconv..."
Dear R users, I am trying to get R to read an .sav data file generated in SPSS 17 for Mac. Here is the command and the error message: > data = read.spss('/Users/userdir/Desktop/filename.sav') Error in iconv(names(rval), cp, "") : unsupported conversion In addition: Warning message: In read.spss("/Users/userdir/Desktop/filename.sav") :
2009 Mar 07
2
Recode factor into binary factor-level vars
How to I "recode" a factor into a binary data frame according to the factor levels: ### example:start set.seed(20) l <- sample(rep.int(c("locA", "locB", "locC", "locD"), 100), 10, replace=T) # [1] "locD" "locD" "locD" "locD" "locB" "locA" "locA" "locA"
2010 Nov 17
2
slicing list with matrices
A list contains several matrices. Over all matrices (list elements) I'd like to access one matrix cell: m <- matrix(1:9, nrow=3, dimnames=list(LETTERS[1:3], letters[1:3])) l <- list(m1=m, m2=m*2, m3=m*3) l[[3]] # works l[[3]][1:2, ] # works l[[1:3]][1, 1] # does not work How can I slice all C-c combinations in the list? S?ren -- S?ren Vogel, Dipl.-Psych. (Univ.), PhD-Student, Eawag,
2005 Jun 13
3
assignment of inidividual variables from spss save files
New to R, can't afford SPSS! Why can't I assign spss variables? Here are the details. > ### I've read in my collaborator's sav file using read.spss, eg > children = read.spss(filename) > ### It has many variables > length(children) [1] 347 > ### and I would like to assign individual variables. > ### I can of course type out all the ones I want, eg >
2008 Sep 07
2
Regression with nominal data
Hi, y is nominal (3 categories), x1 to 3 is scale. What I want is a regression, showing the probability to fall in one of the three categories of y according to the x. How can I perform such a regression in R? Thanks for your help S?ren
2010 Jan 29
2
cbind, row names
Hello, I read the help as well as the examples, but I can not figure out why the following code does not produce the *given* row names, "x" and "y": x <- 1:20 y <- 21:40 rbind( x=cbind(N=length(x), M=mean(x), SD=sd(x)), y=cbind(N=length(y), M=mean(y), SD=sd(y)) ) Could you please help? Thank you S?ren
2010 Apr 16
2
Return a variable name
Hello, how can I return the name of a variable, say "a$b", from a function? fun <- function(x){ return(substitute(x)); } a <- data.frame(b=1:10); fun(a$b) ... returns a$b, but this is a type language, thus I can't use it as a character string, can I? How? Thanks for help, S?ren
2009 Mar 08
1
Summary of data.frame according to colnames and grouping factor
A dataframe holds 3 vars, each checked true or false (1, 0). Another var holds the grouping, r and s: ### start:example set.seed(20) d <- data.frame(sample(c(0, 1), 20, replace=T), sample(c(0, 1), 20, replace=T), sample(c(0, 1), 20, replace=T)) names(d) <- c("A", "B", "C") e <- rep(c("r", "s"), 10) ### end:example How do I get the
2010 May 08
2
Adding NAs to data.frame
Hello, after the creation of a data.frame I like to add NAs as follows: n <- 743; x <- runif(n, 1, 7); Y <- runif(n, 1, 7); Ag6 <- runif(n, 1, 7); df <- data.frame(x, Y, Ag6); # a list with positions: v <- apply(df, 2, function(x) sample(n, sample(1:ceiling(5*n/100), 1), repl=F)); # a loop too much? for (i in 1:length(df)){ df[unlist(v[i]), i] <- NA; } summary(df); This