由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请教建模中ordinal var的处理方法
相关主题
Hierarchical linear regressionone statistic interview question
linear regression 中的categorical datavariable and covariate 的区别?
请教logistic regression的independent variable是categorical急问,在线等:SAS adv certification Question about SELECT v.s IF/THEN ELSE
customer satisfaction survey数据分析的问题请教一个关于PCA的问题
还是个MODEL问题一个关于macro的问题,多谢。
如何在一个regression model里面同时处理continuous和categorical变量请教一个很白痴的回归分析的问题
how to present correlation of two ordinal variables by graphics[合集] 电话面试完了,肯定没戏,大家帮我看看题目,就算学习吧
[合集] Variable selection with 2000 + variables.SAS code help!! thanks
相关话题的讨论汇总
话题: ordinal话题: variable话题: variables话题: education话题: cubic
进入Statistics版参与讨论
1 (共1页)
s**f
发帖数: 365
1
请大家帮我回答一下!感谢!
regression模型中ordinal的independent var,比如Education,有6个level:低于8年
纪,8年级毕业,一些高中,高中毕业,一些大学,大学毕业。
先想问一下,因为有6个级别,是不是先要test有没有quad,cubic,tet和quin的
function(X^2,X^3,X^4,X^5)存在?
还有一个问题就是,如果是用effect或者reference coding的话,那就损失了ordinal
的信息,是不是干脆就approximate,code为1,2,3,4,5,6?这样做需要什么条件

谢谢!
A*******s
发帖数: 3942
2
it's usual to treat ordinal variable as categorical. In ur case, it's also
ok to code them from 1 to 6, especially since the variable look like equally
spaced in terms of "years of education".

ordinal

【在 s**f 的大作中提到】
: 请大家帮我回答一下!感谢!
: regression模型中ordinal的independent var,比如Education,有6个level:低于8年
: 纪,8年级毕业,一些高中,高中毕业,一些大学,大学毕业。
: 先想问一下,因为有6个级别,是不是先要test有没有quad,cubic,tet和quin的
: function(X^2,X^3,X^4,X^5)存在?
: 还有一个问题就是,如果是用effect或者reference coding的话,那就损失了ordinal
: 的信息,是不是干脆就approximate,code为1,2,3,4,5,6?这样做需要什么条件
: ?
: 谢谢!

s**f
发帖数: 365
3
Thank you for the reply!
In your projects, do you test quadratic and cubic functions of these
variables? Or more often, just assume they are not there?

equally

【在 A*******s 的大作中提到】
: it's usual to treat ordinal variable as categorical. In ur case, it's also
: ok to code them from 1 to 6, especially since the variable look like equally
: spaced in terms of "years of education".
:
: ordinal

A*******s
发帖数: 3942
4
it's a judgmental call. linear models are everywhere but u can always
include curvature into ur models as long as it makes sense.

【在 s**f 的大作中提到】
: Thank you for the reply!
: In your projects, do you test quadratic and cubic functions of these
: variables? Or more often, just assume they are not there?
:
: equally

z**********i
发帖数: 12276
5
越简单越好吧.

【在 s**f 的大作中提到】
: Thank you for the reply!
: In your projects, do you test quadratic and cubic functions of these
: variables? Or more often, just assume they are not there?
:
: equally

s**f
发帖数: 365
6
是的
我已经试过了,quad,cubic都drop out了。
把Education当成一个continuous的var,值是123456就可以了。应该是比code成dummy
或者effect要好。

【在 A*******s 的大作中提到】
: it's a judgmental call. linear models are everywhere but u can always
: include curvature into ur models as long as it makes sense.

s**f
发帖数: 365
7
请大家帮我回答一下!感谢!
regression模型中ordinal的independent var,比如Education,有6个level:低于8年
纪,8年级毕业,一些高中,高中毕业,一些大学,大学毕业。
先想问一下,因为有6个级别,是不是先要test有没有quad,cubic,tet和quin的
function(X^2,X^3,X^4,X^5)存在?
还有一个问题就是,如果是用effect或者reference coding的话,那就损失了ordinal
的信息,是不是干脆就approximate,code为1,2,3,4,5,6?这样做需要什么条件

谢谢!
A*******s
发帖数: 3942
8
it's usual to treat ordinal variable as categorical. In ur case, it's also
ok to code them from 1 to 6, especially since the variable look like equally
spaced in terms of "years of education".

ordinal

【在 s**f 的大作中提到】
: 请大家帮我回答一下!感谢!
: regression模型中ordinal的independent var,比如Education,有6个level:低于8年
: 纪,8年级毕业,一些高中,高中毕业,一些大学,大学毕业。
: 先想问一下,因为有6个级别,是不是先要test有没有quad,cubic,tet和quin的
: function(X^2,X^3,X^4,X^5)存在?
: 还有一个问题就是,如果是用effect或者reference coding的话,那就损失了ordinal
: 的信息,是不是干脆就approximate,code为1,2,3,4,5,6?这样做需要什么条件
: ?
: 谢谢!

s**f
发帖数: 365
9
Thank you for the reply!
In your projects, do you test quadratic and cubic functions of these
variables? Or more often, just assume they are not there?

equally

【在 A*******s 的大作中提到】
: it's usual to treat ordinal variable as categorical. In ur case, it's also
: ok to code them from 1 to 6, especially since the variable look like equally
: spaced in terms of "years of education".
:
: ordinal

A*******s
发帖数: 3942
10
it's a judgmental call. linear models are everywhere but u can always
include curvature into ur models as long as it makes sense.

【在 s**f 的大作中提到】
: Thank you for the reply!
: In your projects, do you test quadratic and cubic functions of these
: variables? Or more often, just assume they are not there?
:
: equally

相关主题
如何在一个regression model里面同时处理continuous和categorical变量one statistic interview question
how to present correlation of two ordinal variables by graphicsvariable and covariate 的区别?
[合集] Variable selection with 2000 + variables.急问,在线等:SAS adv certification Question about SELECT v.s IF/THEN ELSE
进入Statistics版参与讨论
z**********i
发帖数: 12276
11
越简单越好吧.

【在 s**f 的大作中提到】
: Thank you for the reply!
: In your projects, do you test quadratic and cubic functions of these
: variables? Or more often, just assume they are not there?
:
: equally

s**f
发帖数: 365
12
是的
我已经试过了,quad,cubic都drop out了。
把Education当成一个continuous的var,值是123456就可以了。应该是比code成dummy
或者effect要好。

【在 A*******s 的大作中提到】
: it's a judgmental call. linear models are everywhere but u can always
: include curvature into ur models as long as it makes sense.

s**f
发帖数: 365
13
Please help
How to add a "_A" to all the names of the variables in the dataset?
Thank you!
P****D
发帖数: 11146
14
Why do you want to do that?
I have done something similar before using macros. Don't know if my approach
is the easiest.
First use PROC CONTENTS to export all the variable names into a dataset, so
all these variable names are values of a string variable. Then add "_A" to
these values (Google if you don't know how to manipulate string variables).
Then use loop to generate a string macro variable whose CONTENT looks like
this "rename x = x_A; rename y=y_A;". Then you can execute that macro
variable as if it were SAS command.
Very tedious job. Don't do it until you have a good reason...

【在 s**f 的大作中提到】
: Please help
: How to add a "_A" to all the names of the variables in the dataset?
: Thank you!

P****D
发帖数: 11146
15
Or you can do this:
http://support.sas.com/resources/papers/proceedings09/075-2009.

【在 s**f 的大作中提到】
: Please help
: How to add a "_A" to all the names of the variables in the dataset?
: Thank you!

s**f
发帖数: 365
16
Thank you for the suggestion!
I have a baseline survey and a followup survey. They have identical
variables. I would like to merge the two dataset and do some analysis. So I
am thinking renaming the variables. For example, variable OC3 in the 1st and
2nd survey will be renamed to OC3_A and OC3_B, respectively.
Is there a better way to approach this problem?

approach
so
.

【在 P****D 的大作中提到】
: Why do you want to do that?
: I have done something similar before using macros. Don't know if my approach
: is the easiest.
: First use PROC CONTENTS to export all the variable names into a dataset, so
: all these variable names are values of a string variable. Then add "_A" to
: these values (Google if you don't know how to manipulate string variables).
: Then use loop to generate a string macro variable whose CONTENT looks like
: this "rename x = x_A; rename y=y_A;". Then you can execute that macro
: variable as if it were SAS command.
: Very tedious job. Don't do it until you have a good reason...

P****D
发帖数: 11146
17
http://support.sas.com/resources/papers/proceedings09/075-2009

I
and

【在 s**f 的大作中提到】
: Thank you for the suggestion!
: I have a baseline survey and a followup survey. They have identical
: variables. I would like to merge the two dataset and do some analysis. So I
: am thinking renaming the variables. For example, variable OC3 in the 1st and
: 2nd survey will be renamed to OC3_A and OC3_B, respectively.
: Is there a better way to approach this problem?
:
: approach
: so
: .

s**f
发帖数: 365
18
Great! Thanks!

【在 P****D 的大作中提到】
: http://support.sas.com/resources/papers/proceedings09/075-2009
:
: I
: and

P****D
发帖数: 11146
19
Baozi!!!

【在 s**f 的大作中提到】
: Great! Thanks!
s**f
发帖数: 365
20
Sent! Thanks!

【在 P****D 的大作中提到】
: Baozi!!!
1 (共1页)
进入Statistics版参与讨论
相关主题
SAS code help!! thanks还是个MODEL问题
一道SAS面试题,关于dummy variable如何在一个regression model里面同时处理continuous和categorical变量
sampling weight variable怎么用到linear regression里啊?how to present correlation of two ordinal variables by graphics
SAS help : The scope of macro variables[合集] Variable selection with 2000 + variables.
Hierarchical linear regressionone statistic interview question
linear regression 中的categorical datavariable and covariate 的区别?
请教logistic regression的independent variable是categorical急问,在线等:SAS adv certification Question about SELECT v.s IF/THEN ELSE
customer satisfaction survey数据分析的问题请教一个关于PCA的问题
相关话题的讨论汇总
话题: ordinal话题: variable话题: variables话题: education话题: cubic