[R] cross validation for species distribution

2009-12-30 Thread elaine kuo
Dear, I wanna make cross-validation for the species data of species distribution models. Please kindly suggest any package containing cross validation suiting the purpose. Thank you. Elaine [[alternative HTML version deleted]] __ R-help@r-pro

Re: [R] cross validation for species distribution

2010-01-01 Thread elaine kuo
might help you get better answers. > > There are a few packages and functions to do what (I think) you desire. > There is the train function in the caret package, the errorest function in > ipred and a few in e1071. > > Max > > > > > On Dec 31, 2009, at 12:13 AM,

[R] Boxplot- change y axis partition

2010-01-01 Thread elaine kuo
Hello, I am a newbie to R. Now I am learning to draw boxplot using graphics(). I want to change the default setting of y asix. from 0, 0.1, 0.2,0.8 to 0, 0.4, 0.8. Please kindly share the command and thank you. Elaine [[alternative HTML version deleted]] _

[R] Boxplot- change the vertical line from dash to solid

2010-01-01 Thread elaine kuo
Dear, I am a newbie to R. Now I am learning to draw boxplot using graphics(). I want to change the vertical line penetrating the box from dashed line to solid line Please kindly share the command and thank you. Elaine [[alternative HTML version deleted]] _

[R] Boxplot- input the median point and the median value

2010-01-01 Thread elaine kuo
Dear, I am a newbie to R. Now I am learning to draw boxplot using graphics(). I want to highlight the median position with a round point and the value left (or on the top of)to the point. Please kindly share the command and thank you. Elaine [[alternative HTML version deleted]] _

[R] to discriminate AUC of different models

2010-01-01 Thread elaine kuo
Dear, Regarding the methodology comparing the power of AUC generated by differernt models, please kindly suggest any R code available for the function. (similar to DeLong, DeLong, and Clarke-Pearson (1988) ) Thank you very much. Elaine [[alternative HTML version deleted]]

Re: [R] Boxplot- change the vertical line from dash to solid

2010-01-04 Thread elaine kuo
Dear Dieter, Thanks for the info. However, I did not know which document you refer to. Please kindly indicate the website or the source. Thank you Elaine On Mon, Jan 4, 2010 at 4:24 PM, Dieter Menne wrote: > > > > elaine kuo wrote: > > > > Now I am learning to draw box

[R] BIOMOD: the format of background data

2010-01-04 Thread elaine kuo
Dear, I am a newbie to R. I am trying BIOMOD to simulate species distributions with presence-only data. As the presence-only data consist of three columns, presence, longitude, latitude, please kindly share how to prepare the background data (maybe using ArcGIS ?) Thank you Elaine [[

[R] no "rcorrp.cens" in hmisc package

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. I tried improveProb function's example code below. set.seed(1) library(survival) x1 <- rnorm(400) x2 <- x1 + rnorm(400) d.time <- rexp(400) + (x1 - min(x1)) cens <- runif(400,.5,2) death <- d.time <= cens d.

[R] Are unpaired data suitable for Hmisc's improveProb ?

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. The AUC for model 1 consists of two columns, column A for 0/1 and column B for probability, eahc with the same row number of 3000. The AUC for model 2 consists of two columns, column A for 0/1 and column B f

[R] Are unpaired data suitable for DiagnosisMed's Diagnosis ?

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. The AUC for model 1 consists of two columns, column A for 0/1 and column B for probability, eahc with the same row number of 3000. The AUC for model 2 consists of two columns, column A for 0/1 and column B f

Re: [R] Boxplot- input the median point and the median value

2010-01-10 Thread elaine kuo
PM, elaine kuo wrote: > >> Dear, >> >> I am a newbie to R. >> >> Now I am learning to draw boxplot using graphics(). >> >> I want to highlight the median position >> >> with a round point and the value left (or on the top of)to the point. &

[R] rotate y axis label and resize its font

2010-01-12 Thread elaine kuo
Dear , As a newbit to R learning boxplot, please kindly share how to rotate y axis lable by 90 degrees or 180 degrees clockwise. Also, please advise how to resize the label font and change its color. Thank you Elaine [[alternative HTML version deleted]]

[R] error of betadiver in vegan

2013-07-11 Thread Elaine Kuo
Hello, I am using betadiver (vegan) to calculate beta diversity. However, an error message shows Error in ifelse(x > 0, 1, 0) : (list) object cannot be coerced to type 'double' R version: 3.0.0 Please kindly advise how to solve the issue. Also, please kindly tell if any more information is i

Re: [R] error of betadiver in vegan

2013-07-12 Thread Elaine Kuo
,dataNP,by=c("GID"),all=T) dim(dataR) str(dataR) library(vegan) ## The beta sim index (Lennon 2001) d <- betadiver(dataR, "sim") On Fri, Jul 12, 2013 at 2:13 PM, Jari Oksanen wrote: > Elaine Kuo gmail.com> writes: > > > > > Hello,

[R] memory problem of betadiver of vegan

2013-07-12 Thread Elaine Kuo
Hello List, This is Elaine. I am running betadiver for a dataset of 4873 rows and 2749 columns. (4873 rows = 4873 gridcell of the study region and 2749 columns for the bird species) The dataset was produced by combing 5 dbf. When running the code o, an error message jumped out, saying "Error: can

Re: [R] memory problem of betadiver of vegan

2013-07-12 Thread Elaine Kuo
Hello List, I solved the problem by using the code with 31 votes http://stackoverflow.com/questions/1358003/tricks-to-manage-the-available-memory-in-an-r-session On Sat, Jul 13, 2013 at 6:15 AM, Elaine Kuo wrote: > Hello List, > > This is Elaine. > I am running betadiver for a dat

[R] extract beta.sim from dist type data (package betapart)

2013-07-17 Thread Elaine Kuo
Dear List, This is Elaine. I am using beta.part to calculate the beta diversity index. The function of beta.part can generate three kinds of beta diversity indice at one time. However, it is Simpson index that I want. The calculation result is composed of three rows and N/A columns (dist class).

Re: [R] [R-sig-eco] extract beta.sim from dist type data (package betapart)

2013-07-19 Thread Elaine Kuo
wrote: > Replied to on the R-sig-ecology list, with a request not to cross-post. > > Briefly, the output is a list with named components, so can be > extracted as usual. > > Sarah > > On Wed, Jul 17, 2013 at 5:50 AM, Elaine Kuo > wrote: > > Dear List, > > >

[R] how to calculate the average values of each row in a matrix

2013-07-19 Thread Elaine Kuo
Hello, I have a matrix (class matrix) composed of GridCell (row and column). The matrix value is the beta diversity index value between two grids. Now I would like to get the average value of each GridCell. Please kindly advise how to make the calculation. Thank you. Elaine The matrix looks lik

[R] merge matrix row data

2013-07-31 Thread Elaine Kuo
Dear list, I have a matrix showing the species presence-absence on a map. Its rows are map locations, represented by GridCellID, such as GID1 and GID 5. Its columns are species ID, such as D0989, D9820, and D5629. The matrix is as followed. Now I want to merge the GridCellID according to t

Re: [R] merge matrix row data

2013-07-31 Thread Elaine Kuo
<-c("GID 1", "GID 5") > IslandB<- c("GID 2", "GID 4", "GID 7") > res<- t(sapply(c("IslandA","IslandB"),function(x) > {x1<-mat1[match(get(x),row.names(mat1)),];(!!colSums(x1))*1} )) > > res > #

Re: [R] merge matrix row data

2013-07-31 Thread Elaine Kuo
Sums(x1)})) > #D0989 D9820 D5629 D4327 D2134 > #IslandA FALSE FALSE TRUE FALSE TRUE > #IslandB TRUE FALSE FALSE TRUE FALSE > > t(sapply(c("IslandA","IslandB"),function(x) {x1<- > mat1[match(gsub(".*\\s+","",get(x)),row.names(m

Re: [R] merge matrix row data

2013-07-31 Thread Elaine Kuo
10 0 0 > 7 0 1 0 0 1 > ",sep="",header=TRUE)) > IslandA<-c("GID 1", "GID 5") > IslandB<- c("GID 2", "GID 4", "GID > 7")t(sapply(c("IslandA","

Re: [R] merge matrix row data

2013-08-01 Thread Elaine Kuo
quot;D0473", "D0475", "D0488", "D0489", "D0492", "D0493", "D0504", "D0536" ))) On Thu, Aug 1, 2013 at 1:24 PM, Elaine Kuo wrote: > Hello Arun > > Thank for comments. > > You are right. GID is the first

[R] Fwd: calculating dissimilarity index of islands (vegan and betapart)

2013-09-06 Thread Elaine Kuo
Dear List, This is Elaine, a postgraduate studying in bird distributions in East Asia. I want to calculate Simpson dissimilarity index, based on a presence/absence matrix of bird species in islands in East Asia. (matrix row: 36 islands/matrix column: species ID) (R package vegan to make NM

[R] to retrieve specific data from a matrix

2013-09-11 Thread Elaine Kuo
Dear list, I want to retrieve a specific data from a matrix with 3000 columns. The matrix has island ID as its rows and species ID as its columns. There are 20 rows and 3000 columns in the matrix. (Island ID: Species 1- Species 20/ species ID: Species 1- Species 3000) The contents of the matrix gr

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
ur data that you can post > in your email along with your question. You do not use it in your analysis. > You originally posted a table of your data that requires extra steps for us > to convert into a useable form so I suggested you use dput in the future to > create a version of

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
the data to > r-help. You cannot compute statistics or graphics from the result of the > dput() function. > > Yes you can produce a barplot. Type ?barplot to get the instructions. > > -- > David L Carlson > Associate Professor of

[R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
Hello, I have data of Body length and Body weight of 8 boys and 7 girls. I want to draw the plot of Body length (for X) and Body weight (for Y) based on sex. Then the two plots want to be overlapped for comparison. I used the code below but found the unit length of X axis of boy and girl plot ar

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
t; col=c("firebrick3","saddlebrown")[as.numeric(together$sex)], ) > > Regards > Petr > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Elaine Kuo >> Sent: Monday, January 0

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
places. Elaine On Mon, Jan 7, 2013 at 8:11 PM, Elaine Kuo wrote: > Thanks a lot. > Please kindly indicate the meaning of the c(8,7). > >> together <- rbind(boy, girl) >> together$sex <- factor(rep(c("boy", "girl"), c(8,7))) > > Elaine > &g

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
Hello, Thanks again. But something wrong with the subset after lm > > It is not about drawing plot many times but coding points or graphic objects > by some factor. In your case sex. > > Instead of > boyline<-lm(body_weight ~ body_length, boy) > > use collective data frame together and subset on

Re: [R] plot xaxp issue

2013-01-07 Thread Elaine Kuo
omitted for numbers. Thanks again. Elaine On Tue, Jan 8, 2013 at 8:40 AM, Elaine Kuo wrote: > boyline<-lm(body_weight ~ body_length, data=together, > subset(together,sex=="boy")) __ R-help@r-project.org mailing list https://stat.ethz.c

[R] error in a abline loop

2013-01-07 Thread Elaine Kuo
Hello I have data of body length and body weight of people of different skin colors. I tried to write a code to plot body length and body weight according to the skin colors. (Thanks for Petr's advice so far.) A loop is used but an error shows up in the following code. It says: unexpected '}' i

Re: [R] error in a abline loop

2013-01-07 Thread Elaine Kuo
t;,"darkorange2", > "red3","saddlebrown","coral4","grey38")[i],lwd=2) > } > > > A.K. > > > > - Original Message - > From: Elaine Kuo > To: r-help@r-project.org > Cc: > Sent: Monday, January 7, 2013 8:23

[R] add categorical labels in plot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a plot using the code below. Further, I want to add labels (White, Yellow, Red) to x-axis. Please kindly advise how to add the categorical labels, by modifying the code. Thank you. Elaine Code dataN <-read.csv("H:/skin_color.csv",header=T, row.names=1) dim(dataN)

[R] two-group comparison in boxplot

2013-01-11 Thread Elaine Kuo
Hello I have a data composing three columns: body weight, body length, and sex. I want to draw a box plot, X-axis for body weight, Y-axis for body length. In the boxplot, I want to compare the body length between two sexes of three groups of body weight: <50, 51-100, >101 kg. (For instance

[R] how to change font size of axis label (not axis title)

2013-01-11 Thread Elaine Kuo
Hello, I am using lattice to produce xyplot. I want to change the font size of axis-X label. Please kindly advise how to write the code. Thank you. For changing the font size of axis-X title it would be xlab=list("Diet of Breeding Ground", cex = 1.4) Elaine [[alternative HTML versio

[R] panel failure in xyplot

2013-01-11 Thread Elaine Kuo
Hello I ran the code below but it said: no object "'panel.xyplot.intermediate.hh'" Please kindly advise how to modify the code. thank you. (It works with panel.bwplot.intermediate.hh) Elaine code library(HH) # data input dataN <-read.csv("H:/R_data/Mig_bird_586.csv",header=T, row.names

[R] color in xyplot

2013-01-11 Thread Elaine Kuo
Hello I want to draw a xyplot. Its dots will have three colors: red for meat, green for vegetable, and blue for both. I used the code below but could not make the dot in the same group show the same color. Please kindly advise how to modify it. Thank you. code library (lattice) diet.code <- c(

[R] customize color in xyplot

2013-01-12 Thread Elaine Kuo
Hello I want to draw a plot and classify the dot by different color, according to the habitats. I am using xyplot in lattice but do not know how to assign specific colors to the habitats. Please kindly advise how to modify the code. Thank you. Elaine code dataN <-read.csv("H:/Mig_bird_586_

[R] how to draw confidence interval lines of a fitted curve of polynominal regression

2013-02-06 Thread Elaine Kuo
Hello, I drew a plot of weight and height of people and fitted it with a polynominal regression x^2. (using curve()) Now I would like to draw the confidence interval line for the fitted curve. Please kindly advise the code for the purpose. Thank you. Elaine [[alternative HTML version de

[R] how to make a median line thicker in bwplot (lattice)

2013-02-11 Thread Elaine Kuo
Hello, I am drawing a boxplot using bwplot in lattice. I would like to learn how to draw a thicker median line instead of the default setting. Thank you. Code bwplot(, pch=rep("|",2)) Elaine [[alternative HTML version deleted]] _

[R] how to change whisker width in bwplot (lattice)

2013-02-11 Thread Elaine Kuo
Hello, I am using lattice to draw boxplots. I would like to make the whisker look shorter than the box width. Please kindly advise how to modify the code. Thank you. Elaine code bwplot(x,y, pch=rep("|",2), box.umbrella = list(col = "black", lty = 1)) [[alternative HTML version deleted]

[R] locating boxplot in bwplot (lattice)

2013-02-22 Thread Elaine Kuo
Hello I am using lattice bwplot to draw migration distance of three groups of birds. The boxplots from the left to right is displayed in alphabetic order of the boxplot names, as the default setting. However, I would like the boxplots from the left to right to be displayed according to the

Re: [R] locating boxplot in bwplot (lattice)

2013-02-23 Thread Elaine Kuo
On Sat, Feb 23, 2013 at 6:29 AM, Ben Bolker wrote: > Elaine Kuo gmail.com> writes: > > > > > Hello > > > > I am using lattice bwplot to draw migration distance of three groups of > > birds. > > > > The boxplots from the left to right is display

Re: [R] locating boxplot in bwplot (lattice)

2013-02-24 Thread Elaine Kuo
quot;blue"), fill = c("red", "green", "blue")), superpose.line = list(col = c("red", "green", "blue")) ) xyplot( result ~ time | location, data=dataset,groups=genotype,pch=19, type = "b", par.settings = par.settings) On Sun, Feb 24

Re: [R] locating boxplot in bwplot (lattice)

2013-02-24 Thread Elaine Kuo
, No. become red.) Please kindly advise R-code that can specify the red color for No. 1 and 2, the blue color for the rest. Thanks again. Elaine On Mon, Feb 25, 2013 at 4:17 AM, Peter Ehlers wrote: > On 2013-02-24 03:50, Elaine Kuo wrote: > >> Hello >> >> Thank you for th

Re: [R] locating boxplot in bwplot (lattice)

2013-02-27 Thread Elaine Kuo
Hello, I used "group" in dotplot to classify diet by colors. Elaine On Mon, Feb 25, 2013 at 6:27 AM, Elaine Kuo wrote: > Hello > > sorry that I did not make the letter clearly stated. > > Now I have 21 boxplots (No. 1, No. 2No. 21 from the left to the > right)(

[R] put strip below the panel (dotplot)

2013-02-28 Thread Elaine Kuo
Hello I am using lattice dotplot and I would like to put the strip under the panel. I found the code “strip” is for the strip above the panel, and “strip.left” for the strip left to the panel. Please kindly advise how to write the code for the strip under the panel Thank you Elaine

[R] resizing panels but some strip letters disappeared (dotplot)

2013-02-28 Thread Elaine Kuo
Hello, I am using library(latticeExtra) resizePanels to have better visual display in dotplot (lattice). However, some panels became smaller and the strip letters of those panels were partially missing. Please kindly advise how to keep all strip letters remaining when resizing panels. Thank you.

[R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello, This is Elaine. I am using R 3.0 to download package vegan but failed. The warning message is package ‘vegan’ successfully unpacked and MD5 sums checked Warning: unable to move temporary installation ‘C:\Users\elaine\Documents\R\win-library\3.0\file16c82da53b1b\vegan’ to ‘C:\Users\elaine\

Re: [R] failed to download vegan

2013-04-16 Thread Elaine Kuo
Hello All, I manually moved the vegan.zip to ‘C:\Users\elaine\Documents\R\ win-library\3.0\vegan’. Then unzipping the file. It worked to require "vegan" Elaine On Wed, Apr 17, 2013 at 8:56 AM, Elaine Kuo wrote: > Hello, > > This is Elaine. > > I am using R 3.0 to d

[R] MOS-test using package vegan

2013-04-20 Thread Elaine Kuo
Dear all, I am using MOStest in vegan to examine the hump-shaped of a quadratic regression model. In the manual of vegan, it mentions that the value of MOStest include isHump. My result showed the quadratic regression is hump-shaped according to the p-value (nearly 0). However, the value isHump di

[R] significantly different from one (not zero) using lm

2013-04-30 Thread Elaine Kuo
Hello, I am work with a linear regression model: y=ax+b with the function of lm. y= observed migration distance of butterflies x= predicted migration distance of butterflies Usually the result will show if the linear term a is significantly different from zero based on the p-value. Now I

[R] significant test of two quadratic regression models (lm)

2013-05-03 Thread Elaine Kuo
Hello, I am work with two quadratic regression models y=ax^2+bx+c with the function of lm. y1= observed migration distance of butterflies(y1=a1x^2+b1x+c1) y2= predicted migration distance of butterflies (based on body mass) (y2=a2x^2+b2x+c2) x= body mass of butterflies Now I would like to c

[R] R package for bootstrapping (comparing two quadratic regression models)

2013-05-03 Thread Elaine Kuo
Hello , I want to compare two quadratic regression models with non-parametric bootstrap. However, I do not know which R package can serve the purpose, such as boot, rms, or bootstrap, DeltaR. Please kindly advise and thank you. Elaine The two quadratic regression models are y1=a1x^2+b1x+c1 y1=

Re: [R] significantly different from one (not zero) using lm

2013-05-04 Thread Elaine Kuo
1429604 -0.34650900 >> > mypval >> (Intercept) x >> 0.9886229 0.7297031 >> > myt <- (coef(lm1) - 1)/seofb >> > mypval <- 2*pt(abs(myt), lower.tail = FALSE, df = lm1$df.residual) >> > myt >> (Intercept) x >>

[R] slope coefficient of a quadratic regression bootstrap

2013-05-05 Thread Elaine Kuo
Hello, I want to know if two quadratic regressions are significantly different. I was advised to make the test using step 1 bootstrapping both quadratic regressions and get their slope coefficients. (Let's call the slope coefficient *â*^1 and *â*^2) step 2 use the slope difference *â*^1-

Re: [R] slope coefficient of a quadratic regression bootstrap

2013-05-05 Thread Elaine Kuo
t vector } boot.fit2 <- boot(dataN, function.fit2, 1000) On Mon, May 6, 2013 at 7:36 AM, Elaine Kuo wrote: > Hello, > > I want to know if two quadratic regressions are significantly different. > I was advised to make the test using > step 1 bootstrapping both quadrati

[R] compare two quadratic regression using bootstrap

2013-05-05 Thread Elaine Kuo
Hello, I want to know if two quadratic regressions are significantly different. I was advised to make the test using step 1 bootstrapping both quadratic regressions and get their slope coefficients. (Let's call the slope coefficient *â*^1 and *â*^2) step 2 use the slope difference *â*^1-

Re: [R] R package for bootstrapping (comparing two quadratic regression models)

2013-05-06 Thread Elaine Kuo
me, the second one does not. Isn't y2 in the second equation equal to > the estimated y1 from the first equation? You need to talk with someone > about what you have, where it came from, and what questions you are trying > to answer. > > Jean > > > On Fri, May 3, 2

[R] pearson correlation significant level

2013-05-17 Thread Elaine Kuo
Hello I am using package Hmisc to calculate the pearson correlation and the significant level for the matrix of t_i and t_r. (temperature minimum and temperature range) However, I have difficulty interpreting the result, even after checking the manual. Please kindly help to indicate if the p-valu

[R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
Hello, I am making a boxplot of 13 boxes. I tried to color the box using 13 colors but failed. Only red and brown were displayed. Green, blue, and grey disappeared. Please kindly advise modification after checking the code below. Thank you in advance. Elaine R code # data input dataN <-read

Re: [R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
ot;darkblue","navy","grey38") > bwplot(GE_distance ~ Diet_B, data=dataN, >xlab=list("Diet of Breeding Ground", cex = 1.4), >ylab = list( > "Distance between Centers of B and NB Range (1000 km)", > cex = 1.

Re: [R] boxplot of different colors

2012-09-24 Thread Elaine Kuo
producible example > included in your email using dput() would allow us to answer you more > effectively. > > Sarah > > > On Mon, Sep 24, 2012 at 6:23 PM, Elaine Kuo > wrote: > > Hello, > > > > I am making a boxplot of 13 boxes. > > I tried to color the

[R] boxplot of multi box color

2012-09-24 Thread Elaine Kuo
Hello, I want to draw a boxplot using 13 colors for 13 boxes. Each box represents a type of diet of birds. Y axis is the breeding range of the birds. I checked the previous r-help and found a possible solution. However, it did not work by showing "error in ncol(Diet_B)," Diet_B not found. Please

Re: [R] boxplot of different colors

2012-09-25 Thread Elaine Kuo
ienna2","red2","firebrick3","saddlebrown","coral4", > "chocolate4","darkblue","navy","grey38") > levels(dataN$Diet_B) <- Diet.colors > bwplot(GE_distance ~ Diet_B, data=dataN, >

[R] changing outlier shapes of boxplots using lattice

2012-09-27 Thread Elaine Kuo
Hello This is Elaine. I am using package lattice to generate boxplots. Using Richard's code, the display was almost perfect except the outlier shape. Based on the following code, the outliers are vertical lines. However, I want the outliers to be empty circles. Please kindly help how to modify th

Re: [R] changing outlier shapes of boxplots using lattice

2012-09-28 Thread Elaine Kuo
gl(13,20), > fill = Diet.colors, pch = "|", > par.settings = list(box.umbrella=list(lty=1))) > > cheers > > > > I initially set the pch="|" to match your first >> example with the horizontal >> indicator for the median. I would be incline

[R] two indirect effects of path analysis

2012-10-06 Thread Elaine Kuo
Hello, This is Elaine. I am trying a path analysis using lavaan Package. There are three explanatory variables: X, Z, and M. The response variable is Y. A, b, and c have direct effects on Y. On the other hand, X and Z also have direct effects on M. In other words, X and Z have indirect effects

[R] lm and glm

2012-10-23 Thread Elaine Kuo
Dear list, I am making a linear regression of the following format. lm(Y~X1+X2+log(X3)+log(X4)) Now I would like to check the linear regression above using generalized linear model. Please kindly if the following format is correct and thank you. (If it is wrong, please indicate why.) glm(Y~X1+

[R] change lm log(x) to glm poisson

2012-10-28 Thread Elaine Kuo
Hello list, I am running a regression using lm(Y~A+B+log(C)+log(D)) Now, I would like to test if glm can produce similar results. So the code was revised as glm(Y~A+B+C+D, family=poisson) (code 1) However, I found some example using glm for lm. It suggests that the code should be revised lik

Re: [R] change lm log(x) to glm poisson

2012-10-30 Thread Elaine Kuo
ctors so even though the poisson family includes a log link, it >> will not yield the same results as a log transformation of two of your >> predictors. >> >> I do not have any online references off the top of my head, but it >> seems like you may be well served by reading

[R] average X value of specific Y

2012-12-15 Thread Elaine Kuo
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X)latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I woul

[R] averaging X of specific Y (latitude)

2012-12-15 Thread Elaine Kuo
Hello I have a table describing butterfly range traits. It is composed of three columns as below Species name range size (X)latitude of range midpoint (Y) There are 11 kinds of butterflies. Each has its range size, and the latitude of each range midpoint ranges from 9 to 19. I woul

Re: [R] [R-sig-Geo] averaging X of specific Y (latitude)

2012-12-15 Thread Elaine Kuo
; > > From: r-sig-geo-boun...@r-project.org [r-sig-geo-boun...@r-project.org] > on behalf of Elaine Kuo [elaine.kuo...@gmail.com] > Sent: Saturday, December 15, 2012 10:15 PM > To: r-help@r-project.org; r-sig-geo > Subject: [R-sig-Geo] avera

Re: [R] averaging X of specific Y (latitude)

2012-12-16 Thread Elaine Kuo
calculation? Thank you. Elaine > > > > - Original Message - > From: David L Carlson > To: 'Elaine Kuo' ; r-help@r-project.org; > 'r-sig-geo' > Cc: > Sent: Sunday, December 16, 2012 11:32 AM > Subject: Re: [R] averaging X of specific Y (latit

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
12 851.550 > 4 16 690.770 > 5 18 766.155 > > --- > David > > > From: Elaine Kuo [mailto:elaine.kuo...@gmail.com] > Sent: Sunday, December 16, 2012 5:17 PM > To: dcarl...@tamu.edu; r-help@r-project.org; r-sig-...@stat.math.ethz.ch >

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
Thank you, Berend. I tried 1. dput (datam, "datam") 2. dput (datam) both worked Elaine On Mon, Dec 17, 2012 at 7:30 PM, Berend Hasselman wrote: > > On 17-12-2012, at 12:06, Elaine Kuo wrote: > > > Hello, > > > > Thank you again, David. > > >

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
.5, + 450.68, 1102.38, 893.34, 820.2, 872.2, 488.2, 620.11, 982.78, + 720.32, 912.2), Latitude = c(9.45, 10.2, 9.3, 16.4, 10.54, 10.87, + 16.79, 18.3, 12.98, 12.67, 18.07)), .Names = c("Species", "Range", + "Latitude"), class = "data.frame", row.names = c(N

Re: [R] averaging X of specific Y (latitude)

2012-12-17 Thread Elaine Kuo
ly C1", "Butterfly C2"), class = "factor"), Range = c(130.5, + 450.68, 1102.38, 893.34, 820.2, 872.2, 488.2, 620.11, 982.78, + 720.32, 912.2), Latitude = c(9.45, 10.2, 9.3, 16.4, 10.54, 10.87, + 16.79, 18.3, 12.98, 12.67, 18.07)), .Names = c("Species", "Range&quo

[R] search species with all absence in a presence-absence matrix

2013-09-20 Thread Elaine Kuo
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I

[R] Compare species presence and absence between sites

2013-09-27 Thread Elaine Kuo
Dear List, I want to compare the presence and absence of bird species based on the sites in a matrix. The matrix has 5 rows for Island A, B, C, D, and E. It has 100 columns for bird species D001-D100. In each cell of the matrix, the presence-absence of bird species will be recorded as 1 or 0

Re: [R] Compare species presence and absence between sites

2013-09-27 Thread Elaine Kuo
ERS[1:5]),] > lst1<- lapply(seq_len(nrow(dat1)),function(i) > {x<-mat1[unlist(dat1[i,]),]; which(different(x[1,],x[2,]))}) #using Rui's > function > names(lst1)<- paste(dat1[,1],dat1[,2],sep="_") > > > A.K. > > > > - Original Message --

[R] row sum with all absence in a presence-absence matrix

2013-10-08 Thread Elaine Kuo
Dear list I have a matrix composed of islandID as rows and speciesID as columns. IslandID: Island A, B, C….O (15 islands in total) SpeciesID: D0001, D0002, D0003….D0100 (100 species in total) The cell of the matrix describes presence (1) or absence (0) of the species in an island. Now I

[R] compute coefficient of determination (R-squared) for GLM (maximum likelihood)

2010-06-20 Thread elaine kuo
Dear, I want to compute coefficient of determination (R-squared) to complement AIC for model selection of multivariable GLM. However, I found this is not a built-in function in glm. neither is it available through reviewing the question in the R-help archive. Please kindly help and thanks a lot.

[R] how to find observed Moran's I value using moran.test(spdep)

2010-06-21 Thread elaine kuo
Dear , This is Elaine. I am computing moran's I using moran.test for a generalized linear model (multiregression). The following contents are the results, and I cannot find the observed Moran's I mentioned as estimate in the manual. Please kindly help indicate if there is observed Moran's I did

[R] process of stepwise selection

2010-06-29 Thread elaine kuo
Dear list, I wanna select the significant variables relative to bird distribution, using stepwise method. However, the result is always the best-fit model. Please kindly suggest if it is possible to show the selection process. Thank you Elaine [[alternative HTML version deleted]] _

[R] package anacor possible for formula lm ?

2010-07-16 Thread elaine kuo
Dear list I found package anacor very user-friendly but wanted to learn more after reading the publication "a simple..." and its manual. Please kindly help with the following questions and thanks in advance. 1. is it possible to implement lm formula in anacor? 2. is there manual to a

[R] cca in vegan (formula instead of community matrix data)

2010-07-16 Thread elaine kuo
Dear List, I tried to do cca based on species data and environmental variables (formula instead of community data). However, there was an error saying row sums must be >0. I searched the previous related messages but found few solutions. Please kindly help and thank you in advance. code This is

[R] data.frame required for cca in ade4

2010-07-16 Thread elaine kuo
Dear List, I tried to conduct cca using csv data but failed. The message said that data.frame is required. Please kindly share how to convert a csv-imported file to a data.frame. Thank you. Elaine code rm(list=ls()) spec <-read.csv("c:/migration/M_R_20100718_winterM_spec_vegan.csv",header=T, r

[R] cca in ade4

2010-07-16 Thread elaine kuo
Dear List, I used spec and envi for cca in ade4. (both are data.frame) However, there is a message telling that error in if (nf > rank) nf <- rank R missing value in TRUE/FALSE Please kindly help how to modify the code below. Thank you. Elaine code rm(list=ls()) spec <-read.csv("c:/migration

[R] producing biplot of canonical correlation analysis

2010-07-18 Thread elaine kuo
Dear List, I would like to obtain biplot containing arrows and variable labels. However, after checking the previous message and package CCA and function anacor, my attempt remains an open question. Please kindly advise code or package I might miss to achieve it. Thank you. Elaine [[al

[R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread elaine kuo
Dear List, I ran a regression model using lm and produced a regression line using abline. The line ranges from -20 to 20 in x axis, and the section I only want is from -20 to 0. Please kindly advise any function in abline () to set the range of x axes. Thank you Elaine [[alter

[R] how to show the number of each axis interval (plot)

2010-09-20 Thread elaine kuo
Dear List, I am using plot for homework. The x-axis covered from 0 to 80, with 4 intervals. However, the plot only showed 0, 40, 80. 20 and 60 disappeared. Please kindly advise how to show 0, 20, 40, 60, 80 for the axis interval. Thank you. Elaine [[alternative HTML version deleted]]

[R] Extracting data subset for plot

2010-10-11 Thread elaine kuo
Dear list, I want to make a plot based on the following information, using the command plot. variable A for x axis : temperature (range: -20 degrees to 40 degree) variable B for y axis : altitude (range: 50 m to 2500 m ) The data below 0 degree of X variable wants to be erased tentatively.

[R] delta AIC for models with 2 variables using MuMIn

2010-10-12 Thread elaine kuo
Dear List, I want to ask a AIC question based on package library(MuMIn) The relative importance of 16 explanatory variables are assessed using delta AIC in a generalized linear model. Please kindly advise if it is possible to show models with any two only certain variables. Thank you. Elai

[R] discerning plot dots using colors

2010-10-26 Thread elaine kuo
Dear List, I am using the command plot to present the relationship between bird richness (Y axis) and elevation (X axis). However, I would like to observe the distributions of bird richness in different administrative areas (A, B, C, …., G) in this plot. For example, the dots in area A mig

  1   2   >