similar to: reshape package does not recognize second id variable

Displaying 20 results from an estimated 4000 matches similar to: "reshape package does not recognize second id variable"

2008 Sep 27
2
reshape "Error in data[, timevar] : incorrect number of dimensions"
I have two waves of a survey given to students at various middle schools and high schools, with student id numbers for each student. I am having difficulty reshaping the file from long to wide. My code is below: library(foreign) svy <- read.spss("studsur4.SAV") svy.wide <- reshape(svy, timevar="WAVE", idvar="id", direction="wide")
2008 Dec 22
1
sem package fails when no of factors increase from 3 to 4
#### I checked through every 3 factor * 3 loading case. #### While, 4 factor * 3 loading failed. #### the data is 6 factor * 3 loading require(sem); cor18<-read.moments(); 1 .68 1 .60 .58 1 .01 .10 .07 1 .12 .04 .06 .29 1 .06 .06 .01 .35 .24 1 .09 .13 .10 .05 .03 .07 1 .04 .08 .16 .10 .12 .06 .25 1 .06 .09 .02 .02 .09 .16 .29 .36 1 .23 .26 .19 .05 .04 .04 .08 .09 .09 1 .11 .13 .12 .03 .05 .03
2013 Apr 13
1
how to add a row vector in a dataframe
Hi, Using S=1000 and simdata <- replicate(S, generate(3000)) #If you want both "m1" and "m0" #here the missing values are 0 res1<-sapply(seq_len(ncol(simdata.psm1)),function(i) {x1<-merge(simdata.psm0[,i],simdata.psm1[,i],all=TRUE); x1[is.na(x1)]<-0; x1}) res1[,997:1000] #????? [,1]???????? [,2]???????? [,3]???????? [,4]??????? #x1??? Numeric,3000 Numeric,3000
2011 Jun 23
0
Loops, Paste, Apply? What is the best way to set up a list of many equations?
Is there a way to apply paste to?list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)?such that I don't have to write form1=EQ1 for all my models?(I might have a list of 20 or more)? I also need the EQs to read the formulas associated with them. For example, below, I was able to automate the name assignment but I could not figure out how to?to set up the list using?paste or other
2009 Apr 07
2
Using as.formula() with the reshape package cast
I am trying to use the "cast" function from the reshape package, where the formula is not passed in directly, but as the result of the as.formula() function. Using reshape v. 0.7.2 I am able to properly melt() by data with: > molten <- melt(x, id=1:2) then I can properly cast with this: > cast(molten, days ~ variable) but if I try > cast(molten,
2007 May 16
1
partial least regression
hello r-helpers: there is a .txt file: x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 y1 17 5 77 18 19 24 7 24 24 72 52 100 2 6 72 18 17 15 4 12 18 35 42 97.2 17 2 58 10 5 3 4 3 3 40 28 98 17 2 69 14 13 12 4 6 6 50 37 93 2 3 75 20 38 18 6 12 18 73 67 99 14 4 59 16 18 9 4 3 15 47 40 99.95 17 4 87 18 17 12 4 15 12 69 46 100 14 3 74 15 9 12 1 15 12 44 35 98 17 6 76 15 33 21 15 9 18 46 41 100 17 5 76 17 22 18 1
2006 Nov 17
2
Data table in C
After getting one list done, I am now struggling to form a data frame in C. I tried to do a list of lists which gives me : $<NA> $<NA>[[1]] [1] "BID" $<NA>[[2]] [1] 0.6718 $<NA>[[3]] [1] 3e+06 $<NA> $<NA>[[1]] [1] "BID" $<NA>[[2]] [1] 0.6717 $<NA>[[3]] [1] 5e+06 $<NA> $<NA>[[1]] [1] "BID"
2010 Jun 06
1
I need help in analyzing
I'm sory for my weak english. I need to analyze this subject : x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 y 0 0 1 0 0 1 0 0 1 0 czarne 1 1 0 0 0 0 1 0 0 0 rude 0 0 1 0 0 1 1 0 0 0 braz 0 0 1 0 1 0 1 0 0 0 blond 1 0 0 0 0 1 0 0 0 1 rude 1 1 0 0 0 0 0 0 0 1 blond 0 0 1 1 0 0 0 0 1 0 czarne 1 0 0 1 0 0 1 0 0 0 blond 0 0 1 0 0 1 1 0 0 0 blond 1 0 0 0 0 1 1 0 0 0 czarne 0 0 1 0 0 1 0 0 0 1 czarne 1 0 1 0 0 0
2011 Jun 01
3
error in model specification for cfa with lavaan-package
Dear R-List, (I am not sure whether this list is the right place for my question...) I have a dataframe df.cfa
2017 Dec 21
1
[bug report] null ptr deref in nouveau_platform_probe (tegra186-p2771-0000)
I applied the changes manually. This time, Xorg is actually starting... [ 16.862744] WARNING: CPU: 3 PID: 381 at drivers/gpu/drm/nouveau/nouveau_bo.c:280 nouveau_bo_new+0x450/0x4d0 [nouveau] [ 16.873333] Modules linked in: nouveau i2c_algo_bit ttm tegra_drm gpio_keys drm_kms_helper drm drm_panel_orientation_quirks(P) host1x dwmac_dwc_qos_eth stmmac_platform stmmac ptp pps_core syscopyarea
2011 Apr 09
2
Orthoblique rotation on eigenvectors (SAS VARCLUS)
Hi All, I'd like to build a package for the community that replicates the output produced by SAS "proc varclus". According to the SAS documentation, the first few steps are: 1. Find the first two principal components. 2. Perform an orthoblique rotation (quartimax rotation) on eigenvectors. 3. Assign each variable to the rotated component with which it has the higher squared
2013 May 29
3
bootstrap
Hi, You might need to check library(boot).? I have never used that before.? So, I can't comment much.? It is better to post on R-help list.? I had seen your postings on Nabble in the past.? Unfortunately those postings were not accepted in R-help.? You have to directly post at ? r-help at r-project.org after registering at: https://stat.ethz.ch/mailman/listinfo/r-help ?
2013 Apr 18
1
select and do some calculations/manipulations on certain rows based on conditions in R
Hi, May be this helps (Assuming that there are only '0's and '1's in the dataset) dat1<-read.table(text=" ??????? ID X0 X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15 1?? 5184??? 0??? 0??? 0??? 0??? 0?? 0?? 0??? 0??? 0??? 1???? 0????? 0????? 0????? 0????? 0????? 0 2?? 6884??? 0??? 0??? 1??? 0??? 0?? 1?? 0??? 0??? 0??? 0???? 0????? 0????? 0????? 0????? 0????? 0 3?
2011 Dec 19
2
Summing x1 to x6
Suppose I have the following: x1<-as.vector(rnorm(10)) x2<-as.vector(rnorm(10)) x3<-as.vector(rnorm(10)) x4<-as.vector(rnorm(10)) x5<-as.vector(rnorm(10)) x6<-as.vector(rnorm(10)) x7<-as.vector(rnorm(10)) x8<-as.vector(rnorm(10)) x9<-as.vector(rnorm(10)) x10<-as.vector(rnorm(10)) I would like the mean of x1 to x6 for each vector position. I would do something else
2010 Nov 24
0
nonparametric covariance analysis
Hi there, I want to do a nonparametric covariance analysis and I have tried to use the package "sm" function "sm.ancova" but it didn't work for me because I have more then one covariates (I have 18 covariates and 3 factors). I want to analyse for one factor (who has 13 levels) where the differences for my response are, using the explanatory (covariates). (The other two
2012 Nov 21
0
Making part of a data frame into a time series
Dear folks ? I have a bunch of data frames where columns 1:(n-1) contain information about a county, and columns n and higher contain a time series of monthly observations on that county. I wanted to get the data in columns n and higher to be recognized as a bunch of time series. So I wrote a function that was supposed to turn all the columns from a given column number on into a time series: #
2010 Apr 19
2
How to pass a list of parameters into a function
Does anyone know how to pass a list of parameters into a function? for example: somefun=function(x1,x2,x3,x4,x5,x6,x7,x8,x9){ ans=x1+x2+x3+x4+x5+x6+x7+x8+x9 return(ans) } somefun(1,2,3,4,5,6,7,8,9) # I would like this to work: temp=c(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9) somefun(x1=1,x2=2,temp) # OR I would like this to work: temp=list(x3=3,x4=4,x5=5,x6=6,x7=7,x8=8,x9=9)
2011 Jun 28
2
How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work
Greetings R Users, I have a system of equations for which I would like to output all the R-squares. Assume there are four equations in my system, the only way I found to output all the R-squares is by calling them out one by one as this: summary(fitSUR$eq[[1]])$r.squared summary(fitSUR$eq[[2]])$r.squared summary(fitSUR$eq[[3]])$r.squared summary(fitSUR$eq[[4]])$r.squared But isn't there a
2015 Feb 19
2
[LLVMdev] ScheduleDAGInstrs computes deps using IR Values that may be invalid
Hi All, I've encountered an issue where tail merging MIs is causing a problem with the post-RA MI scheduler dependency analysis and I'm not sure of the best way to address the problem. In my case, the branch folding pass (lib/CodeGen/BranchFolding.cpp) is merging common code from BB#14 and BB#15 into BB#16. It's clear that there are 4 common instructions (marked with an *) in BB#14
2005 Apr 30
1
Memory consumption, integer versus factor
R is so smart! I found that when you switch a column from integer to factor, the memory consumption goes down rather impressively. Now I'd like to learn more. How does R do this? What does R do? How do I learn more? I got to thinking: If I was really smart, I'd see that a factor with 2 levels requires only 1 bit of storage. So I'd be able to cram 8 such factors into a byte. But this