[MORPHMET] MANOVA

2018-09-07 Thread Ian F
Hey everyone, 
I am trying to run MANOVA on some morphometric data to determine if three 
groups of specimens are statistically distinct. but i am receiving the 
error code 

Error in summary.manova(Raf.manova1) : residuals have rank 27 < 60.


Can anyone spot what i am doing wrong?
My data is attached and my script is as follows



data1<-Classifier.table.two

names(data1)


Raf.manova1<- 
manova(cbind(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8,x9,y9,x10,y10,x11,y11,x12,y12,x13,y13,x14,y14,x15,y15,x16,y16,x17,y17,x18,y18,x20,y20,x21,y21,x22,y22,x23,y23,x24,y24,x25,y25,x26,y26,x27,y27,x28,y28,x29,y29,x30,y30,x31,y31)~as.factor(group),data=data1)

summary(Raf.manova1)

summary(Raf.manova1,test = "Pillal")

summary(Raf.manova1, test = "wilks")

summary(Raf.manova1, test = "Hotelling-Lawley")

summary(Raf.manova1, test = "Roy")


Thank you for your time.
-Ian

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.
group   x1  y1  x2  y2  x3  y3  x4  y4  x5  
y5  x6  y6  x7  y7  x8  y8  x9  y9  x10 
y10 x11 y11 x12 y12 x13 y13 x14 y14 x15 
y15 x16 y16 x17 y17 x18 y18 x19 y19 x20 
y20 x21 y21 x22 y22 x23 y23 x24 y24 x25 
y25 x26 y26 x27 y27 x28 y28 x29 y29 x30 
y30 x31 y31
Rafalt  288014372843.903226 16002835.193548 17642780
1909.709677 27102040.612903 26182149.516129 2513
2245.419355 2388.677419 23222219.774194 23542028.870968 
23641854.967742 234916782337.064516 15592255.16129  
1470.258065 214313962016.354839 1334.451613 18771293
1717.548387 12581551.645161 12851387.741935 1306.16129  
120813371037.935484 1457.967742 958 1650.870968 950 
1844.774194 943 2038.677419 936 2204.580645 947 2378
974.483871  2557.387097 996 2737.290323 10172863
1092.193548 28941250.096774
Rafalt  3178144931321676.806452 30501868.612903 
2981.580645 207428642230.225806 2720.967742 2361
2549.16129  24632364.354839 25522120.548387 2582
1859.741935 25811618.935484 254814062487.129032 1244
2375.322581 1115.516129 2230998 2073.709677 922 
1875.903226 864 1660.096774 871 1409.290323 914 
1178.483871 979 969.6774194 1137.129032 854 1350.935484 
794 1583.741935 753 1819.548387 715 2044.354839 670 
2277.16129  711 2525.967742 736 2774.774194 761 
2972.580645 837 3144.387097 936 31771180.193548
Rafalt  3220155332191795.870968 31592035.741935 3064
2240.612903 2938.516129 241527932569.354839 2665.774194 
27142427.903226 27082220.032258 280020222730.16129  
1816.290323 26361607.419355 254514162436.548387 
1247.677419 230511002152.806452 996.9354839 1956919 
1734.064516 854 1503.193548 846 1267.322581 908 
1029.451613 1081.419355 903 1323.290323 845 1558.16129  
780 1810731.9677419 2054684.0967742 2300705.7741935 
2577728.6451613 2837.516129 768 3066839.3870968 3205
1000.258065 32361269.129032
Rafalt  273315072714.258065 16542668.516129 17922636
1935.225806 25682050.967742 2456.290323 21232315.548387 
21662179.806452 22142031.064516 22491863.322581 2257
1715.580645 22211594.83871  215815042065.096774 1420
1965.354839 13501851.612903 12961721.870968 1286
1556.129032 13001398.387097 12571261.645161 1279.096774 
11301423.83871  109115651048.419355 17211020.677419 
1889.064516 10052052.806452 989 2209.548387 10142371
1022.290323 2520.032258 10572663.774194 10972726.516129 
121827301358.258065
Rafalt  2669161526761799.806452 26461969.612903 
2572.580645 210624892232.225806 2382.967742 2336
2254.16129  241721152487.645161 19562497.548387 
1774.741935 25191591.935484 25041449.129032 2441
1348.322581 2332

[MORPHMET] Re: Trouble with 2-D morphomeric analysis in geomorph

2018-08-12 Thread Ian F
im sorry to ask so many questions. How would I reformat the script you have 
provided to convert 2686 observations of 2 variables (x and y coordinates) 
into wide format? when i try to alter it i end up with millions of rows. 

On Thursday, August 2, 2018 at 1:32:02 PM UTC-4, Ian F wrote:
>
> I am trying to do an analysis of three specimens. I am using 
> semi-landmarks and having trouble. perhaps someone can point out mt error? 
> these are my results 
>
> Generalized Procrustes Analysis 
> with Partial Procrustes Superimposition 
>
> -4 fixed landmarks 
> 12 semilandmarks (sliders) 
> 2-dimensional landmarks 
> 6 GPA iterations to converge 
> Minimized Bending Energy used 
>
>
> Consensus (mean) Configuration 
>
>X   Y 
> [1,]  0.51447153 -0.03794928 
> [2,]  0.36957021  0.11431610 
> [3,] -0.11602250  0.19898458 
> [4,] -0.40489951  0.11095030 
> [5,] -0.43738229 -0.09965594 
> [6,] -0.20913543 -0.09698422 
> [7,]  0.04257626 -0.09131803 
> [8,]  0.29799009 -0.04811314 
>
> it should be three individuals with 4 landmarks and 4 sliders each. i want 
> to perform PCA on the procrustes coordinates. my code and data are below. 
> Im new to R and its probably an easy fix im just really confused. any help 
> is greatly appreciated.   
>
>
>
>
>
>
> Code:Y <- arrayspecs(coordsrformat, k=2, p= ncol(coordsrformat)/2) 
>
> slidermatrix 
>
> Y.gpa <- gpagen(Y,curves=slidermatrix)   
> summary(Y.gpa) 
> plot(Y.gpa) 
>
> Y.gpa <- gpagen(Y,curves=slidermatrix,ProcD=FALSE )   
> summary(Y.gpa) 
> plot(Y.gpa) 
> a<-(Y.gpa$coords) 
> plotTangentSpace(a) 
>
>
>
>
> slider matrix:   
>
> beforeslideafter 
> 567 
> 781 
> 123 
> 345 
> 187 
> 765 
> 543 
> 321 
> 123 
> 345 
> 567 
> 781 
>
>
> coordsrformat: 
>
>
> 163018271530154911981345908   
>  15578331840102718951223
> 190714171887 
>
> 2767108126331581213920471693  
>   175315351159184110672151
> 100924371071 
>
> 295692829361692211223601300   
>  17841304101617008882084
> 8322480872 
>
>
>
>
>

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.


[MORPHMET] digit.curves

2018-08-12 Thread Ian F
Does digit.curves require data in long on wide format? when i try to use it 
i get the error  

 "  Error in digit.curves(2880, Rafalt1, nPoints = 30, closed=TRUE): 
  Input must be a p-x-k matrix of curve coordinates" 

what is a p-x-k matrix. I have searched it on the internet and have come up 
with nothing.I have tried both long and wide format and have had the same 
result. any help is much appreciated.

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.


[MORPHMET] Re: Trouble with 2-D morphomeric analysis in geomorph

2018-08-10 Thread Ian F
Thank you very much Carmelo. You have been immensely helpful.

On Thursday, August 2, 2018 at 1:32:02 PM UTC-4, Ian F wrote:
>
> I am trying to do an analysis of three specimens. I am using 
> semi-landmarks and having trouble. perhaps someone can point out mt error? 
> these are my results 
>
> Generalized Procrustes Analysis 
> with Partial Procrustes Superimposition 
>
> -4 fixed landmarks 
> 12 semilandmarks (sliders) 
> 2-dimensional landmarks 
> 6 GPA iterations to converge 
> Minimized Bending Energy used 
>
>
> Consensus (mean) Configuration 
>
>X   Y 
> [1,]  0.51447153 -0.03794928 
> [2,]  0.36957021  0.11431610 
> [3,] -0.11602250  0.19898458 
> [4,] -0.40489951  0.11095030 
> [5,] -0.43738229 -0.09965594 
> [6,] -0.20913543 -0.09698422 
> [7,]  0.04257626 -0.09131803 
> [8,]  0.29799009 -0.04811314 
>
> it should be three individuals with 4 landmarks and 4 sliders each. i want 
> to perform PCA on the procrustes coordinates. my code and data are below. 
> Im new to R and its probably an easy fix im just really confused. any help 
> is greatly appreciated.   
>
>
>
>
>
>
> Code:Y <- arrayspecs(coordsrformat, k=2, p= ncol(coordsrformat)/2) 
>
> slidermatrix 
>
> Y.gpa <- gpagen(Y,curves=slidermatrix)   
> summary(Y.gpa) 
> plot(Y.gpa) 
>
> Y.gpa <- gpagen(Y,curves=slidermatrix,ProcD=FALSE )   
> summary(Y.gpa) 
> plot(Y.gpa) 
> a<-(Y.gpa$coords) 
> plotTangentSpace(a) 
>
>
>
>
> slider matrix:   
>
> beforeslideafter 
> 567 
> 781 
> 123 
> 345 
> 187 
> 765 
> 543 
> 321 
> 123 
> 345 
> 567 
> 781 
>
>
> coordsrformat: 
>
>
> 163018271530154911981345908   
>  15578331840102718951223
> 190714171887 
>
> 2767108126331581213920471693  
>   175315351159184110672151
> 100924371071 
>
> 295692829361692211223601300   
>  17841304101617008882084
> 8322480872 
>
>
>
>
>

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.


[MORPHMET] Re: Trouble with 2-D morphomeric analysis in geomorph

2018-08-08 Thread Ian F
I figured out what the issue was. thank you for your help. regrettably I 
have encountered another issue, any insight  would be much appreciated. I 
am trying to reformat a spreadsheet so that each individual is a row and 
each column represents an x or y coordinate. my data set consists of 30 
specimens each with 30 landmarks. I keep getting the error code  Error in 
`[<-`(`*tmp*`, j, 1, value = sub.data[1, 1]) : 
  subscript out of bounds. 

My data is in the link and my code is as follows.


# reformat data from imageJ into R compatible format. 

data <- read.table(Trial2rawcoords.txt, header=TRUE)

len <- length(data$X)
  
overall.table <- matrix(nrow=len/30, ncol=(30*2)+1)
  
overall.length <- len/30
  
for(j in c(1:overall.length)) {
  
print(j)

sub.data <- as.matrix(data[ (1+30*(j-1)):((1+30*(j-1))+29), 2:4])

overall.table[j,1] <- sub.data[1, 1]
overall.table[j,2:3] <- sub.data[1, 2:3]
overall.table[j,4:5] <- sub.data[2, 2:3]
overall.table[j,6:7] <- sub.data[3, 2:3]
overall.table[j,8:9] <- sub.data[4, 2:3]
overall.table[j,10:11] <- sub.data[5, 2:3]
overall.table[j,12:13] <- sub.data[6, 2:3]
overall.table[j,14:15] <- sub.data[7, 2:3]
overall.table[j,16:17] <- sub.data[8, 2:3]
overall.table[j,18:19] <- sub.data[9, 2:3]
overall.table[j,20:21] <- sub.data[10, 2:3]
overall.table[j,22:23] <- sub.data[11, 2:3]
overall.table[j,24:25] <- sub.data[12, 2:3]
overall.table[j,26:27] <- sub.data[13, 2:3]
overall.table[j,28:29] <- sub.data[14, 2:3]
overall.table[j,30:31] <- sub.data[15, 2:3]
overall.table[j,32:33] <- sub.data[16, 2:3]
overall.table[j,34:35] <- sub.data[17, 2:3]
overall.table[j,36:37] <- sub.data[18, 2:3]
overall.table[j,38:39] <- sub.data[19, 2:3]
overall.table[j,40:41] <- sub.data[20, 2:3]
overall.table[j,42:43] <- sub.data[21, 2:3]
overall.table[j,44:45] <- sub.data[22, 2:3]
overall.table[j,46:47] <- sub.data[23, 2:3]
overall.table[j,48:49] <- sub.data[24, 2:3]
overall.table[j,50:51] <- sub.data[25, 2:3]
overall.table[j,52:53] <- sub.data[26, 2:3]
overall.table[j,54:55] <- sub.data[27, 2:3]
overall.table[j,56:57] <- sub.data[28, 2:3]
overall.table[j,58:59] <- sub.data[29, 2:3]
overall.table[j,60:61] <- sub.data[30, 2:3]
  }

# Confirm the above loop worked.

head(overall.table)
tail(overall.table)

# Assign the new table column names and write out the reformatted table to 
the working directory.

colnames(overall.table) <- c("number", "genus", "x1", "y1", "x2", "y2", 
"x3", "y3", "x4", "y4", "x5", "y5", "x6", "y6", "x7", "y7", "x8", "y8", 
"x9", "y9", "x10", "y10", "x11", "y11", "x12", "y12", "x13", "y13", "x14", 
"y14", "x15", "y15", "x16", "y16", "x17", 
"y17","x18","Y18","X19","Y19","X20","Y20","X21","Y21","X22","Y22","X23","Y23","X24","Y24","X25","Y25","X26","Y26","X27","Y27","X28","Y28","X29","Y29","X30","Y30")

write.table(overall.table, "reformat.txt")



On Thursday, August 2, 2018 at 1:32:02 PM UTC-4, Ian F wrote:
>
> I am trying to do an analysis of three specimens. I am using 
> semi-landmarks and having trouble. perhaps someone can point out mt error? 
> these are my results 
>
> Generalized Procrustes Analysis 
> with Partial Procrustes Superimposition 
>
> -4 fixed landmarks 
> 12 semilandmarks (sliders) 
> 2-dimensional landmarks 
> 6 GPA iterations to converge 
> Minimized Bending Energy used 
>
>
> Consensus (mean) Configuration 
>
>X   Y 
> [1,]  0.51447153 -0.03794928 
> [2,]  0.36957021  0.11431610 
> [3,] -0.11602250  0.19898458 
> [4,] -0.40489951  0.11095030 
> [5,] -0.43738229 -0.09965594 
> [6,] -0.20913543 -0.09698422 
> [7,]  0.04257626 -0.09131803 
> [8,]  0.29799009 -0.04811314 
>
> it should be three individuals with 4 landmarks and 4 sliders each. i want 
> to perform PCA on the procrustes coordinates. my code and data are below. 
> Im new to R and its probably an easy fix im just really confused. any help 
> is greatly appreciated.   
>
>
>
>
>
>
> Code:Y <- arrayspecs(coordsrformat, k=2, p= ncol(coordsrformat)/2) 
>
> slidermatrix 
>
> Y.gpa <- gpagen(Y,curves=slidermatrix)   
> summary(Y.gpa) 
> plot(Y.gp

[MORPHMET] Trouble with 2-D morphomeric analysis in geomorph

2018-08-02 Thread Ian F
I am trying to do an analysis of three specimens. I am using semi-landmarks and 
having trouble. perhaps someone can point out mt error? these are my results

Generalized Procrustes Analysis
with Partial Procrustes Superimposition

-4 fixed landmarks
12 semilandmarks (sliders)
2-dimensional landmarks
6 GPA iterations to converge
Minimized Bending Energy used


Consensus (mean) Configuration

   X   Y
[1,]  0.51447153 -0.03794928
[2,]  0.36957021  0.11431610
[3,] -0.11602250  0.19898458
[4,] -0.40489951  0.11095030
[5,] -0.43738229 -0.09965594
[6,] -0.20913543 -0.09698422
[7,]  0.04257626 -0.09131803
[8,]  0.29799009 -0.04811314

it should be three individuals with 4 landmarks and 4 sliders each. i want to 
perform PCA on the procrustes coordinates. my code and data are below. Im new 
to R and its probably an easy fix im just really confused. any help is greatly 
appreciated.  






Code:Y <- arrayspecs(coordsrformat, k=2, p= ncol(coordsrformat)/2)

slidermatrix

Y.gpa <- gpagen(Y,curves=slidermatrix)   
summary(Y.gpa)
plot(Y.gpa)

Y.gpa <- gpagen(Y,curves=slidermatrix,ProcD=FALSE )   
summary(Y.gpa)
plot(Y.gpa)
a<-(Y.gpa$coords)
plotTangentSpace(a) 




slider matrix:  

before  slide   after
5   6   7
7   8   1
1   2   3
3   4   5
1   8   7
7   6   5
5   4   3
3   2   1
1   2   3
3   4   5
5   6   7
7   8   1


coordsrformat:


163018271530154911981345908 1557833 1840
102718951223190714171887 
2767108126331581213920471693175315351159
184110672151100924371071 
2956928 29361692211223601300178413041016
1700888 2084832 2480872



-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.