Continuous or categorical?

802 views
Skip to first unread message

Quentin

unread,
Jun 16, 2008, 2:20:21 AM6/16/08
to Maxent
Hi Masters,

How can I make the difference between continuous and categorical
variables on ASCII files (of course (!)) coming from grid files
(coming from shape files)??

Deriving grid files from shape files, should I minimize the cell size
for better results? Does it matter?

Thanks in advance Masters,

Quentin

Milton Cezar Ribeiro

unread,
Jun 16, 2008, 10:43:06 AM6/16/08
to Max...@googlegroups.com
Hi Quentin & Folks,
 
I don´t know if it is possible to differentiate continuous and categorical variable on ASCII file. By the way, are trying to say "categorical" or "ordinal" variable? I think that you need to be care with "categorical" data (like vegetation or soil type) on your modelling task when using Maxent, Garp, OpenModeller etc. Up to I know no of these tools still deal with categorical data. Case you have presence/absence data, "grasp" package could be a starting point (it work with GAM stead of GLM).
 
Regarding the pixel resolution, when converting from shape to grid, I think that it is better you take in account the scale of mapping of your vector source data. You can up to rasterize with finer resolution, but there are an optimal "threshold" when choosing the pixel size. For example, I never choose pixel size small then 50 meters when my vetor map have scale ~1:100.000. Of course, you can use kriging or other interpolation method to improve better resolution, but it need to be carefull.
 
Good luck.
 
Miltinho
Brazil

 
2008/6/16, Quentin <rena...@gmail.com>:

xime velez-liendo

unread,
Jun 16, 2008, 11:23:26 AM6/16/08
to Max...@googlegroups.com
Quentin,

Typical continuous layers are for example altitude, aspect, slope(a
gradient). If you export those layers as ASCII you will get something
like this:

ncols 6620
nrows 9722
xllcorner -69.198281
yllcorner -22.509139
cellsize 0.0009
NODATA_value -9999
9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 1327 1357 1428
1470 1469 1480 1484 1493 1509 1538 1573 1584 1538 1497 1451 1388 1366
1258 1173 1173 1205 1288 1309 1299 1262 1230 1179 1140 1125 1159 1204
1208 1189 1174 1148 1176 1153 1143 1173 1210 1237 1271 1300 1312 1344
1365 1372 1365 1342 1311 1316 1302 1282 1282 1277 1277 1280 1277 1288
1323 1354 1370 1371 1346 1312 1258 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999

Those values (with exception of the -9999 which is background)
represent a gradient of altitudes.

Categorical layers on the other hand, are for example a vegetation or
soil type layer. The Ascii file will look like something like this:
ncols 6620
nrows 9722
xllcorner -69.198281
yllcorner -22.509139
cellsize 0.0009
NODATA_value -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 3 3 3 3 3 3 3 3 3 3 3
3 3 3 3 3 3 3 3 3 3 3 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999

So, here you have a categorical layer with 8 types of vegetation.
there is no gradient.

Resolution does matter, but it depends on the aims of your study, your
study area size and of course the biology of your species.

cheers,
xime.

2008/6/16 Milton Cezar Ribeiro <miltinho....@gmail.com>:

Niels

unread,
Jun 16, 2008, 11:28:45 AM6/16/08
to Maxent
Hi all,

If you truly want to convert i.e. 8 vegetation types to categorical
variables (0/1) you need a data-layer for each vegetation type (8)
indicating for which grid cells it is present or absent.

Cheers,

Niels

On 16 jun, 17:23, "xime velez-liendo" <xime.velezlie...@gmail.com>
wrote:
> 2008/6/16 Milton Cezar Ribeiro <miltinho.astrona...@gmail.com>:
>
> > Hi Quentin & Folks,
>
> > I don´t know if it is possible to differentiate continuous and categorical
> > variable on ASCII file. By the way, are trying to say "categorical" or
> > "ordinal" variable? I think that you need to be care with "categorical" data
> > (like vegetation or soil type) on your modelling task when using Maxent,
> > Garp, OpenModeller etc. Up to I know no of these tools still deal with
> > categorical data. Case you have presence/absence data, "grasp" package could
> > be a starting point (it work with GAM stead of GLM).
>
> > Regarding the pixel resolution, when converting from shape to grid, I think
> > that it is better you take in account the scale of mapping of your vector
> > source data. You can up to rasterize with finer resolution, but there are an
> > optimal "threshold" when choosing the pixel size. For example, I never
> > choose pixel size small then 50 meters when my vetor map have scale
> > ~1:100.000. Of course, you can use kriging or other interpolation method to
> > improve better resolution, but it need to be carefull.
>
> > Good luck.
>
> > Miltinho
> > Brazil
>
> > 2008/6/16, Quentin <renar...@gmail.com>:

ColinD

unread,
Jun 16, 2008, 5:36:22 PM6/16/08
to Maxent
Thats an interesting point Niels, I have soils categorical data with
50 soil types plus a few other variables with somewhat less. If I
created a 0/1 layer for each I would end up with maybe 100 layers.
Does this make a huge difference to the result? my results so far for
a plant species look quite sensible.

Colin
> > >> Quentin- Hide quoted text -
>
> - Show quoted text -

Sam Veloz

unread,
Jun 16, 2008, 6:53:06 PM6/16/08
to Max...@googlegroups.com
Maxent does handle categorical data so I don't think you need to go
through the trouble of creating binary layers. You just need to specify
that the environmental layer is categorical when you are setting up the
experiment.
Sam

Quentin

unread,
Jun 17, 2008, 1:06:45 AM6/17/08
to Maxent
OK OK Masters!

Thanks for your advices and other suggestions.

By the way, if I understand something at the Maxent's psychology, it
takes the average of the parameters while running with a specific
other one? Well, which kind of average does it take for a categorical
data like vegetation types for instance?

Have a nice day,

Quentin

Quentin

unread,
Jun 17, 2008, 1:16:18 AM6/17/08
to Maxent
Hi Xime,

My vegetation types ASCII file looks like this:

ncols 250
nrows 277
xllcorner 71.632223
yllcorner 7.553777
cellsize 0.041185
NODATA_value -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -99
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -99
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -99
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -99
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999 -9999
-9999

...without any other value!

How could I make the difference between continuous and categorical?


On Jun 16, 8:23 pm, "xime velez-liendo" <xime.velezlie...@gmail.com>
wrote:
> 2008/6/16 Milton Cezar Ribeiro <miltinho.astrona...@gmail.com>:
>
> > Hi Quentin & Folks,
>
> > I don´t know if it is possible to differentiate continuous and categorical
> > variable on ASCII file. By the way, are trying to say "categorical" or
> > "ordinal" variable? I think that you need to be care with "categorical" data
> > (like vegetation or soil type) on your modelling task when using Maxent,
> > Garp, OpenModeller etc. Up to I know no of these tools still deal with
> > categorical data. Case you have presence/absence data, "grasp" package could
> > be a starting point (it work with GAM stead of GLM).
>
> > Regarding the pixel resolution, when converting from shape to grid, I think
> > that it is better you take in account the scale of mapping of your vector
> > source data. You can up to rasterize with finer resolution, but there are an
> > optimal "threshold" when choosing the pixel size. For example, I never
> > choose pixel size small then 50 meters when my vetor map have scale
> > ~1:100.000. Of course, you can use kriging or other interpolation method to
> > improve better resolution, but it need to be carefull.
>
> > Good luck.
>
> > Miltinho
> > Brazil
>
> > 2008/6/16, Quentin <renar...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages