Nominal variables for dummyvar

Hi! I have a cell array of postcodes. With “postcode=nominal;” I tried to transform it into a nominal variable as I want to create dummy variables afterwards. It creates a nominal variable, but unfortunately it does not contain any columns. It seems not to recognize my postcode column.
Can anyone help me? Thank you!:)

댓글 수: 3

Image Analyst
Image Analyst 2014년 6월 23일
Give an example.
Tania
Tania 2014년 6월 23일
Sry, just solved it by myself, thanks anyway. I used B = nominal(postcode) instead of postcode=nominal! thanks anyway!
Tania
Tania 2014년 6월 23일
Hi, I have created a dummyvar for my postcode variable now: dv=dummyvar(B) But I am not sure how I use this now in fitlm (or fitnlm). Without dummyvar I would do the following: >> ds = dataset(price, bedroom, school, transport); >> mdl =fitlm(ds, 'price~bedroom + school + transport') How do I include my dv now into my dataset? My dv has 29 columns. Thank you! PS: I have my document attached!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

질문:

2014년 6월 23일

댓글:

2014년 6월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by