1

I have a trajectory dataset, I used two datasets (longitude and time) to cluster a set of trajectories, I call the Traj package first then I start using the functions, when I apply the factor analysis I had an error:

    install.packages("traj") #Traj package
    library("traj")          #Traj Package

    > dd$A   #the longitude data
         ID        X1        X2        X3        X4        X5        X6
    [1,]  1 -8.610084 -8.610669 -8.610903 -8.610516 -8.610111 -8.610039
    [2,]  2 -8.610111 -8.610759 -8.610831 -8.610723 -8.610471 -8.608203
    [3,]  3 -8.582373 -8.582238 -8.582913 -8.584020 -8.584488 -8.585370
    [4,]  4 -8.601246 -8.601048 -8.601417 -8.600724 -8.598618 -8.597376
    > dd$B  #the time data
         ID t1 t2 t3 t4 t5 t6
    [1,]  1  1 15 30 45 60 75
    [2,]  2  1 15 30 45 60 75
    [3,]  3  1 15 30 45 60 75
    [4,]  4  1 15 30 45 60 75

    >s1 = step1measures(dd$A,dd$B, ID=TRUE) #Apply measurements 
    >s2 = step2factors(s1)                  #Factor Analysis

    I had the following error:

    >     [1] "m6 is removed because it is perfectly correlated with m5"  
    >     [2] "m8 is removed because it is perfectly correlated with m7"  
    >     [3] "m13 is removed because it is perfectly correlated with m12"
    >     [1] "Computing reduced correlation e-values..."
    >     Error in smc(data) : 
    >     m5 is perfectly correlated with a prevois measurment. It must be  removed.m7 is perfectly correlated with a prevois measurment. It must be removed.m9 is perfectly correlated with a prevois measurment. It must be removed.m10 is perfectly correlated with a previous measurment. It must be removed.m11 is perfectly correlated with a previous measurment. It must be removed
rtamimi78
  • 11
  • 2
  • Can you show us the data you're using? Either your measurements are perfectly correlated with each other (as the error message says) or you're providing the data in an incorrect format (so that Traj can't understand it properly) in which case we need to see the data format to help you. – divibisan Apr 18 '18 at 18:02
  • Please use `dput` to include an example of your data in the question. Read this post to learn how to ask a clearer question (in order to get a good answer): https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – divibisan Apr 18 '18 at 18:14
  • How does the `dd` you show in your question relate to the `s1` you pass into `step2factors`? – divibisan Apr 18 '18 at 18:35
  • I edited the question and added the data I used in clustering. Thanks – rtamimi78 Apr 18 '18 at 18:35
  • Sorry, I forgot to add the s1 command, just added – rtamimi78 Apr 18 '18 at 18:37

0 Answers0