Skip to main content
fixed formatting
Source Link
Peter Flom
  • 128.2k
  • 36
  • 184
  • 424

N_TC P_TC P_B P_Val P_Fun N_TC N_B N_Val N_Fun 565 430 144 100 186 135 45 30 60 489 378 98 130 150 111 37 25 49 659 562 230 190 142 97 32 33 32 370 263 90 87 86 107 36 36 35 452 351 117 130 104 101 37 34 30 289 173 60 57 56 116 39 30 47 490 340 115 120 105 100 33 30 36 475 355 120 110 125 120 40 35 45 520 400 149 153 98 120 30 50 40

N_TC    P_TC    P_B  P_Val  P_Fun   N_TC    N_B     N_Val   N_Fun
565     430     144   100    186     135    45       30      60
489     378      98   130    150     111    37       25      49
659     562     230   190    142      97    32       33      32
370     263      90    87    86      107    36       36      35
452     351     117   130    104     101    37       34      30
289     173     60    57     56      116    39       30      47
490     340     115   120    105     100    33       30      36
475     355     120   110    125     120    40       35      45
520     400     149   153     98     120    30       50      40

Following are the steps i have followed. t_design<-read.csv("/home/appsadmin/analytics/T_design.csv",header=TRUE,sep=",") m1<-lm(N_TC~P_TC+P_B+P_Val+P_Fun+N_TC+N_B+N_Val+N_Fun,data=t_design) m11<-lm( N_TC~P_TC+N_TC+N_B+N_Val+N_Fun,data=test_design_prod) # Removed some predictors as they have very low correlation. c1<-predict(m11,interval = "confidence") c1 fit lwr upr 1 565 565 565 2 489 489 489 3 659 659 659 4 370 370 370 5 452 452 452 6 289 289 289 7 490 490 490 8 475 475 475 9 520 520 520.

t_design<-read.csv("/home/appsadmin/analytics/T_design.csv",header=TRUE,sep=",")
m1<-lm(N_TC~P_TC+P_B+P_Val+P_Fun+N_TC+N_B+N_Val+N_Fun,data=t_design)
m11<-lm( N_TC~P_TC+N_TC+N_B+N_Val+N_Fun,data=test_design_prod) # Removed some predictors as they have very low correlation.
c1<-predict(m11,interval = "confidence")

And the output

c1
fit lwr upr
1 565 565 565
2 489 489 489
3 659 659 659
4 370 370 370
5 452 452 452
6 289 289 289
7 490 490 490
8 475 475 475
9 520 520 520. 

N_TC P_TC P_B P_Val P_Fun N_TC N_B N_Val N_Fun 565 430 144 100 186 135 45 30 60 489 378 98 130 150 111 37 25 49 659 562 230 190 142 97 32 33 32 370 263 90 87 86 107 36 36 35 452 351 117 130 104 101 37 34 30 289 173 60 57 56 116 39 30 47 490 340 115 120 105 100 33 30 36 475 355 120 110 125 120 40 35 45 520 400 149 153 98 120 30 50 40

Following are the steps i have followed. t_design<-read.csv("/home/appsadmin/analytics/T_design.csv",header=TRUE,sep=",") m1<-lm(N_TC~P_TC+P_B+P_Val+P_Fun+N_TC+N_B+N_Val+N_Fun,data=t_design) m11<-lm( N_TC~P_TC+N_TC+N_B+N_Val+N_Fun,data=test_design_prod) # Removed some predictors as they have very low correlation. c1<-predict(m11,interval = "confidence") c1 fit lwr upr 1 565 565 565 2 489 489 489 3 659 659 659 4 370 370 370 5 452 452 452 6 289 289 289 7 490 490 490 8 475 475 475 9 520 520 520.

N_TC    P_TC    P_B  P_Val  P_Fun   N_TC    N_B     N_Val   N_Fun
565     430     144   100    186     135    45       30      60
489     378      98   130    150     111    37       25      49
659     562     230   190    142      97    32       33      32
370     263      90    87    86      107    36       36      35
452     351     117   130    104     101    37       34      30
289     173     60    57     56      116    39       30      47
490     340     115   120    105     100    33       30      36
475     355     120   110    125     120    40       35      45
520     400     149   153     98     120    30       50      40

Following are the steps i have followed.

t_design<-read.csv("/home/appsadmin/analytics/T_design.csv",header=TRUE,sep=",")
m1<-lm(N_TC~P_TC+P_B+P_Val+P_Fun+N_TC+N_B+N_Val+N_Fun,data=t_design)
m11<-lm( N_TC~P_TC+N_TC+N_B+N_Val+N_Fun,data=test_design_prod) # Removed some predictors as they have very low correlation.
c1<-predict(m11,interval = "confidence")

And the output

c1
fit lwr upr
1 565 565 565
2 489 489 489
3 659 659 659
4 370 370 370
5 452 452 452
6 289 289 289
7 490 490 490
8 475 475 475
9 520 520 520. 
Source Link

Getting fitted values same as observed values(actual values) after performing glm() in R

i have some sample testing data as shown below.

N_TC P_TC P_B P_Val P_Fun N_TC N_B N_Val N_Fun 565 430 144 100 186 135 45 30 60 489 378 98 130 150 111 37 25 49 659 562 230 190 142 97 32 33 32 370 263 90 87 86 107 36 36 35 452 351 117 130 104 101 37 34 30 289 173 60 57 56 116 39 30 47 490 340 115 120 105 100 33 30 36 475 355 120 110 125 120 40 35 45 520 400 149 153 98 120 30 50 40

Following are the steps i have followed. t_design<-read.csv("/home/appsadmin/analytics/T_design.csv",header=TRUE,sep=",") m1<-lm(N_TC~P_TC+P_B+P_Val+P_Fun+N_TC+N_B+N_Val+N_Fun,data=t_design) m11<-lm( N_TC~P_TC+N_TC+N_B+N_Val+N_Fun,data=test_design_prod) # Removed some predictors as they have very low correlation. c1<-predict(m11,interval = "confidence") c1 fit lwr upr 1 565 565 565 2 489 489 489 3 659 659 659 4 370 370 370 5 452 452 452 6 289 289 289 7 490 490 490 8 475 475 475 9 520 520 520.

I am planning to predict N_TC. but i got the predicted values same as original/observed values (input value).

can some one guide me how to get predicted values for my data set? and which are the further steps i need to perform.