Sub copia_medie()
'
' copia_medie Macro
'
'
Selection.Copy
ActiveCell.Offset(12, 2).Range("A1").Select
ActiveSheet.Next.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(0, 1).Range("A1").Select
ActiveSheet.Previous.Select
Application.CutCopyMode = False
ActiveCell.Range("A1:AI1").Select
Application.CutCopyMode = False
Selection.Copy
ActiveCell.Offset(3, -2).Range("A1").Select
ActiveSheet.Next.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveCell.Offset(1, -1).Range("A1").Select
ActiveSheet.Previous.Select
End Sub
/****************************************************************************************************************************/
'Significatività tra le medie di un segmento e del totale campione 'con scarto quadratico medio Function SQM_Sign_seg1_T(m1, n1, mt, sqmt)
z = Abs(m1 - mt) / (sqmt / Sqr(n1))
If z >= 1.96 Then
If m1 >= mt Then
SQM_Sign_seg1_T = "*"
Else
SQM_Sign_seg1_T = "#"
End If
Else
SQM_Sign_seg1_T = " "
End If
End Function
/****************************************************************************************************************************/
'Significatività tra le percentuale di un segmento e quella del totale campione Function Sign_pct1_pctT(p1, n1, pt)
If (p1 = "" Or p1 = 0) And (pt = "" Or pt = 0) Then
Sign_pct1_pctT = " "
Else
If pt = 0 Then
pt = 0.1
End If
If (p1 / 100 * n1) > 5 And (1 - p1 / 100) * n1 > 5 Then
'Grandi campioni: approssimazione alla normale
z = Abs(p1 - pt) / (Sqr(pt * (100 - pt) / n1))
If z >= 1.96 Then
If p1 >= pt Then
Sign_pct1_pctT = "*"
Else
Sign_pct1_pctT = "#"
End If
Else
Sign_pct1_pctT = " "
End If
Else
'Piccoli campioni: utilizzo la binomiale
inf = (Application.CritBinom(n1, pt / 100, 0.025) - 1) / n1
* 100
sup = (Application.CritBinom(n1, pt / 100, 0.975) + 1) / n1
* 100
If p1 <= inf Or p1 >= sup Then
If p1 >= pt Then
Sign_pct1_pctT = "*"
Else
Sign_pct1_pctT = "#"
End If
Else
Sign_pct1_pctT = " "
End If
End If
End If
End Function
|