similar to: how to combine multiple indicator variables in a single factor

Displaying 20 results from an estimated 5000 matches similar to: "how to combine multiple indicator variables in a single factor"

2009 Aug 24
6
Combining matrices
If I have two matrices like x <- matrix(rep(c(1,2,3),3),3) y <- matrix(rep(c(4,5,6),3),3) How can I combine them to get ? 1 1 1 4 4 4 1 1 1 5 5 5 1 1 1 6 6 6 2 2 2 4 4 4 2 2 2 5 5 5 2 2 2 6 6 6 3 3 3 4 4 4 3 3 3 5 5 5 3 3 3 6 6 6 The number of rows and the actual numbers above are unimportant, they are given so as to illustrate how I want to combine the matrices. I.e., I am looking for
2012 Jul 27
2
How can I access an element of a string?
Dear Daniel and Jorge, Thank you very much and it does help. If I have a string "ABCD", how can I access the second element of the string "B"? Thanks, Miao 2012/7/27 Daniel Nordlund <djnordlund@frontier.com> > > -----Original Message----- > > From: r-help-bounces@r-project.org [mailto:r-help-bounces@r-project.org] > > On Behalf Of jpm miao
2011 Feb 10
1
Revolution Analytics reading SAS datasets
Has anyone heard whether Revolution Analytics is going to release this capability to the R community? http://www.businesswire.com/news/home/20110201005852/en/Revolution-Analytics-Unlocks-SAS-Data Dan Daniel Nordlund Bothell, WA USA
2010 Feb 11
2
SAS and RODBC
I am using R-2.10.1 binary from CRAN on a WinXP Pro system. I also use SAS v9.2 on the same box. I just started using the SAS ODBC driver that comes with version 9 of SAS. I have been able to set up an ODBC source for SAS datasets using the driver, and then with RODBC I am able to read a sample SAS dataset. > library(RODBC) > ch <- odbcConnect('sasodbc', believeNRows=FALSE)
2012 Mar 23
4
Missing Windows binary for R-2.15RC?
Hi, The page http://cran.r-project.org/bin/windows/base/rtest.html has a link to: http://cran.r-project.org/bin/windows/base/R-2.15.0rc-win.exe However, clicking on that link gives a 404 "Object not found' error. FYI. Dan
2013 Apr 18
2
Multiple Multivariate regression in R with 50 independent variables
Hello all Is there a method/package in R in which I can do regressions for more than 50 independent variables ? Regards The woods are lovely, dark and deep But I have promises to keep And miles before I go to sleep And miles before I go to sleep ----- [[alternative HTML version deleted]]
2006 Oct 09
1
where "should" R be installed?
I am a new user of Linux (long time user of Windows) whose only training is from books, articles, and just playing with Linux. I have built and installed R from source, and also installed from RPMs (SuSE). I am wondering where in the file system experienced users of R and Linux typically install R. Are there any conventions, or any reasons to choose one location over another? I know that
2009 May 17
1
sprintf() question
When I type the following, I get results different from what I expected. > sprintf('%a',3) [1] "0x1.8" Shouldn't the result be [1] "0x1.8p+2" I read through the help ?sprintf and didn't find anything that changed my expectation. What am I misunderstanding? I am using R-2.9.0 binary from CRAN on Windows XP Pro, and my session info is >
2009 May 17
1
sprintf() question
When I type the following, I get results different from what I expected. > sprintf('%a',3) [1] "0x1.8" Shouldn't the result be [1] "0x1.8p+2" I read through the help ?sprintf and didn't find anything that changed my expectation. What am I misunderstanding? I am using R-2.9.0 binary from CRAN on Windows XP Pro, and my session info is >
2011 Aug 04
2
Efficient way of creating a shifted (lagged) variable?
Hello! I have a data set: set.seed(123) y<-data.frame(week=seq(as.Date("2010-01-03"), as.Date("2011-01-31"),by="week")) y$var1<-c(1,2,3,round(rnorm(54),1)) y$var2<-c(10,20,30,round(rnorm(54),1)) # All I need is to create lagged variables for var1 and var2. I looked around a bit and found several ways of doing it. They all seem quite complicated - while in
2010 Oct 09
4
same random numbers in different sessions
Dear all I'm using Xubuntu Lucid and I keep getting the same random numbers whenever I start a new session of R. For example, I keep getting > sample(1:1000, 1) [1] 87 or > rnorm(1:10) [1] -1.3618103 0.4241701 1.0720076 0.2208145 -0.5375314 -0.4846588 [7] 0.7576768 0.6527407 -0.6868786 0.8718527 I expected that some set.seed() instruction woudl be present in a config file in
2012 Mar 13
1
suggestions for debugging problem with a package
I am trying to resolve a problem I am having with running the rattle package on two different Windows 7 x64 systems. It appears to be a problem with my two specific systems, because others on Windows 7 x64 systems aren't complaining about this problem. What I am looking for is a method for trying to determine the source of the problem. Here is what I am experiencing. I had Rattle running
2007 Jan 24
1
solving a structural equation model using sem or other package
I am trying to work my way through the book "Singer, JD and Willett, JB, Applied Longitudinal Data Analysis. Oxford University Press, 2003" using R. I have the SAS code and S-Plus code from the UCLA site (doesn't include chapter 8 or later problems). In chapter 8, there is a structural equation/path model which can be specified for the sem package as follows S <- cov(al2)
2006 Dec 13
1
Problem with tuned Rblas from CRAN with R-2.4.0
I encountered the following problem in R-2.4.0 for Windows binary downloaded from CRAN (data from R-help post by Ethan Johnsons). I was also using the contributed binary Rblas.dll for Intel P4 chip. The problem doesn't occur with the default Rblas.dll. x=c(3.05176E-05, 0.000457764, 0.003204346, 0.0138855, 0.04165649, 0.09164429, 0.1527405, 0.1963806, 0.1963806, 0.1527405, 0.09164429,
2007 Nov 22
1
problem updating packages on Ubuntu 7.10
I am running Ubuntu 7.10 and R-2.6.0, and I am having trouble updating packages. There appears to be a problem involving gfortran. For example, here is the output of an attempt to update the Hmisc package. * Installing *source* package 'Hmisc' ... ** libs gfortran -fpic -g -O2 -c cidxcn.f -o cidxcn.o gfortran -fpic -g -O2 -c cidxcp.f -o cidxcp.o gfortran -fpic -g -O2 -c
2010 Feb 13
2
lm function in R
Hello, I am trying to learn how to perform Multiple Regression Analysis in R. I decided to take a simple example given in this PDF: http://www.utdallas.edu/~herve/abdi-prc-pretty.pdf I created a small CSV called, students.csv that contains the following data: s1 14 4 1 s2 23 4 2 s3 30 7 2 s4 50 7 4 s5 39 10 3 s6 67 10 6 Col headers: Student id, Memory span(Y), age(X1), speech rate(X2) Now
2007 Feb 28
3
Datamining-package rattle() Errors
Dear Group I have few errors while installing package rattle from CRAN i do the installing from the local zip files... I am using R 2.4.0 do i have to upgrade to R2.4.1 ? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ utils:::menuInstallLocal() package 'rattle' successfully unpacked and MD5 sums checked updating HTML package descriptions > help(rattle) No
2007 Nov 22
1
Matrix of dummies from a vector
Hallo >From a variable "x" that defines, say, four classes, I would like to define the matrix "mat" of dummy variables indicating the classes, i.e. x <- c(1,1,1,1,2,2,2,3,3,3,4,4) mat <- matrix(c(1,0,0,0, 1,0,0,0, 1,0,0,0, 1,0,0,0, 0,1,0,0, 0,1,0,0, 0,1,0,0, 0,0,1,0, 0,0,1,0, 0,0,1,0, 0,0,0,1, 0,0,0,1), ncol=4, byrow=T) Thank you for your help, Serguei
2007 Apr 20
4
importing sas datasets
Hello, I wanted to ask help about importing sas datasets. 1)I tried with some functions as read.ssd (foreign package), but it doesn't import the file if the length of the variables' names are longer than 8 bite (it has to conform to the 6 version). 2)I then tried with the sas.get function (Hmisc package) but with the command: c<- sas.get(lib="c:\\ghan",
2010 Mar 02
1
sem package and growth curves
I have been working through the book "Applied longitudinal data analysis: modeling change and event occurrence" by Judith D. Singer and John B. Willett. I have been working examples using SAS and also using it as an opportunity for learning to use R for statistical analysis. I ran into some difficulties in chapter 8 which deals with using structural equation modeling. I have tried to